Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have data looks like below
t:
LOAD
* INLINE [VBELN,OBJNR,OBJNR1,Flag
'1000018402\000010',VB1153031859010200,000000000000000000,1
'1450018402\000010',000000000000000000,VB1450018402000010,0
];
t1:
Load
VBELN,
if
(Flag = '1',OBJNR,OBJNR1) as Temp
resident
drop
table t; t;I am expecting to see only one value VB1153031859010200 in the Temp field.
Advance Thanks for your help.
solved.
Not sure why you are expecting only one value in Temp. You have 2 record in table "t" and for those 2 records the correct OBJNR will be loaded in "t1" table due to your IF condition.
If you have to see only one OBJNR, you can put a WHERE condition after "resident t" like:
Load
VBELN,
if (Flag = '1',OBJNR, OBJNR1) as Temp
resident t
WHERE Flag = 1;
Or if you must load both the VBELNs but only one OBJNR where FLag is 1, you can do so by:
Load
VBELN,
if (Flag = '1',OBJNR) as Temp
resident t;
But if I think what you are trying to achieve, having my SAP hat on, I think you would be better off using MAPPING and APPLYMAP, if I guess correctly what you are trying to do.
If nothing of above mentioned works for you, please provide details of what ultimately you are trying to achieve.
Hope this helps.
solved.
Could you pleas validate which method worked for you? Just for my curiosity.