12-15-2007 7:50 AM
Hello to ABAP Gurus
First of all I am zero in ABAP hence please ingnore my lack of knowledge.
Question is that I have written an ABAP routine in transfer rule where I am pulling data from R/3 system into my info objects.
What I would like to do here is that if the date is NULL "Not present at source", I would like to assign the default date to my info object.
My small piece of code looks like below
If TRAN_STRUCTURE-birthdt = ' '.
RESULT = '01/01/9999'.
else.
RESULT = TRAN_STRUCTURE-birthdt.
endif.
Please let me have your expert advice.
Many thanks in Advance.
Regards,
Bobby
12-15-2007 7:55 AM
Try the following code.
<b>IF NOT </b> TRAN_STRUCTURE-birthdt <b>IS INITIAL.</b>
RESULT = TRAN_STRUCTURE-birthdt.
else.
RESULT = '01/01/9999'.
endif.
12-15-2007 7:55 AM
Try the following code.
<b>IF NOT </b> TRAN_STRUCTURE-birthdt <b>IS INITIAL.</b>
RESULT = TRAN_STRUCTURE-birthdt.
else.
RESULT = '01/01/9999'.
endif.
12-15-2007 9:22 AM
Hi Sarvan,
Fantastic answer and thanks you very much.
My next issue here is that I have extracted date from R/3 structure from 0BPARTNER where the birthdate is of type DATS.
I have an info object which is of type date char 8.
All dates are pulled correctly in the format of mm/dd/yyyy but where the birthdate is null in source system, I am defaulting it to either 99990101 or 19000101 but it picks up really random date.
Do I have to use any function here to convert the date format to mm/dd/yyyy?
Any idea?
Many thanks in advance.
Regards,
Bobby
12-15-2007 10:32 AM
Hi Gopal
Use function module <b>CONVERT_DATE_TO_EXTERNAL</b>. This will convert the date to the user specific format. So if your user specific format is mm/dd/yyyy, then this is all you need.
Check below threads as well...
hope it will solve ur problem..
<b>Reward Points if helpful.</b>
Thanks & Regards
ilesh 24x7
12-15-2007 8:36 AM
12-15-2007 8:49 AM
Hi,
if tran_strcuture-birthdt is initial.
result = '99990101'.
else.
result = tran_strucutre-birthdt.
endif.
Thanks,
Sriram Ponna.