Hi,
I have a requirement as follows. There are 2 date fields, Clearing date & Posting date in Datasource. I have to create a Z Infoobject in DSO & fill in the same using this 2 fields. If Clearing date field has data, it should go in to the Z field. If the Clearing date field is Blank, i have to get posting date data & fill it in the Z field.
In Transformation from Datasource to DSO, I wrote a Characteristic routine as below for the Z Object mapping Clearing date & Posting date to the Z field.
IF SOURCE_FIELDS-AUGDT EQ ' '.
RESULT = SOURCE_FIELDS-BUDAT.
ELSE.
RESULT = SOURCE_FIELDS-AUGDT.
ENDIF.
AUGDT is Clearing Date
BUDAT is Posting Date
Problem is when i execute the load, in the Z Object output i get values only when Clearing date field has values. For the rows where Clearing date field is empty, i am not getting the Posting date value in the Z Object output.
I am sure that the code above is right, but why is not putting the Posting date value in the Z Object when Clearing date is empty.
Regards,
Murali
Hi,
Seems like it is never considering AUGDT as blank and always trying to pass SOURCE_FIELDS-AUGDT to the result.
Try this...IF SOURCE_FIELDS-AUGDT is INITIAL.
Hi Murali,
For checking the empty values you will have to use the INITIAL addition and not the single space,
Try following code,
IF SOURCE_FIELDS-AUGDT IS INITIAL'.
RESULT = SOURCE_FIELDS-BUDAT.
ELSE.
RESULT = SOURCE_FIELDS-AUGDT.
ENDIF.
Regards,
Durgesh.
Adding to above just debug this code ie set the
breakpoints and see what value you are getting and
do the necessary change.You can go to debugging mode
by changing the setting in DTP.
Regards,
Saveen Kumar