Hi,
As per my understanding,
You have 10 Part and Cost combination is Datasource.
Like P1, C1, P2,C2, P3, C3,.............P10,C10
You want to select one of these such that Pn <> blank and Cn <> blank
And have to assign them to ZSPR_PART and ZUNIT_CST respectively
For this,
1) Assign P1 to ZSPR_PART and C1 to ZUNIT_CST in transformation. Dont map other Pn and Cn in transformation
2) Write Start Routine as,
LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.
IF<source_fields>-P1 is Not NULL AND and <source_fields>-C1 IS NOT INITIAL .
*Nothing to do
ELSEIF <source_fields>-P2 is Not NULL AND and <source_fields>-C2 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P2.
<source_fields>-C1 = <source_fields>-C2.
ELSEIF <source_fields>-P3 is Not NULL AND and <source_fields>-C3 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P3.
<source_fields>-C1 = <source_fields>-C3.
ELSEIF <source_fields>-P4 is Not NULL AND and <source_fields>-C4 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P4.
<source_fields>-C1 = <source_fields>-C4.
ELSEIF <source_fields>-P5 is Not NULL AND and <source_fields>-C5 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P5.
<source_fields>-C1 = <source_fields>-C5.
ELSEIF <source_fields>-P6 is Not NULL AND and <source_fields>-C6 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P6.
<source_fields>-C1 = <source_fields>-C6.
ELSEIF <source_fields>-P7 is Not NULL AND and <source_fields>-C7 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P7.
<source_fields>-C1 = <source_fields>-C7.
ELSEIF <source_fields>-P8 is Not NULL AND and <source_fields>-C8 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P8.
<source_fields>-C1 = <source_fields>-C8.
ELSEIF <source_fields>-P9 is Not NULL AND and <source_fields>-C9 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P9.
<source_fields>-C1 = <source_fields>-C9.
ELSEIF <source_fields>-P10 is Not NULL AND and <source_fields>-C10 IS NOT INITIAL .
<source_fields>-P1 = <source_fields>-P10.
<source_fields>-C1 = <source_fields>-C10.
ENDIF.
ENDLOOP.