cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to copy data for "Null" field by script

Former Member
0 Likes
453

Hi Expert,

F

rom my capture above, there is no data for "NB0008" and "B0029" since flat file so the system will check first that between NB0008 and B0008 or NB0029 and B0029 which item has the value then copy data to another item that no value

This case the system will copy data from B0008 to NB0008 and NB0029 to B0029

I tried to use script below but it does not work so I changed from "%VALUE%==0" to "%VALUE%==null", it's still not work properly.

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%

*XDIM_MEMBERSET ENTITY = %ENTITY_SET%

*XDIM_MEMBERSET FLOW = F999

*XDIM_MEMBERSET CIT_PROCESS = ALC300_F03B

*XDIM_MEMBERSET ACCOUNT = 52800000_S

*XDIM_MEMBERSET TAXRATE = 100

*XDIM_MEMBERSET RPTCURRENCY = THB

*XDIM_MEMBERSET KF = SRC300

*XDIM_MEMBERSET PCTR = NOPCTR

*WHEN BOINO

*IS B0008

*REC(EXPRESSION = %VALUE%==0?%VALUE%+([BOINO].[NB0008]):%VALUE%,BOINO=B0008,CIT_PROCESS=ALC300_F03B,KF=SRC300,TAXRATE=100,PCTR=NOPCTR,ACCOUNT=52800000_S)

*IS NB0008 *REC(EXPRESSION = %VALUE%==0?%VALUE%+([BOINO].[B0008]):%VALUE%,BOINO=NB0008,CIT_PROCESS=ALC300_F03B,KF=SRC300,TAXRATE=100,PCTR=NOPCTR,ACCOUNT=52800000_S)

*IS B0029 *REC(EXPRESSION = %VALUE%==0?%VALUE%+([BOINO].[NB0029]):%VALUE%,BOINO=B0029,CIT_PROCESS=ALC300_F03B,KF=SRC300,TAXRATE=100,PCTR=NOPCTR,ACCOUNT=52800000_S)

*IS NB0029 *REC(EXPRESSION = %VALUE%==0?%VALUE%+([BOINO].[B0029]):%VALUE%,BOINO=NB0029,CIT_PROCESS=ALC300_F03B,KF=SRC300,TAXRATE=100,PCTR=NOPCTR,ACCOUNT=52800000_S)

*ENDWHEN

*COMMIT

Anyone can recommend me, please let me know

Thanks in advance.

Matee

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor

I do not understand what do you want to achieve, please read: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

In general, if you have no record then WHEN/ENDWHEN loop will not loop this intersection! You have to clearly explain required logic to find some workaround (may be to clear destination before copy)

Answers (1)

Answers (1)

Former Member
0 Likes

Thanks Vadim,

From your answer that said "May be to clear destination before copy"...I tried and found it work!!!

former_member186338
Active Contributor
0 Likes

Yes, this is a traditional approach in this case!