‎2007 Apr 11 7:12 AM
Hi gurus,
For my script i designed a layout such that in a single line i have to print date, number, name. Suppose if the date is initial then the number and name is aligned in different format. To fix the number,name in a particular position i had written the following code.
/: if &itab-date& is initial.
Date: Name:&itab-name& number: &itab-num&
/: else.
Date:&itab-date& Name:&itab-name& number: &itab-num&
/:endif.
Problem here is am getting two lines in output like
Date: Name : xxxxxxxx Number : xxxxxxxxx
Date: xxxxxxx Name:xxxxxxxxx Number: xxxxxx
It is not checking the if statement.
What is the solution for this.
Points will be awarded.
Regards
Ravi
‎2007 Apr 11 7:16 AM
JUST TRY LIKE THIS
/: if &itab-date(C)& EQ '00000000'
Date: Name:&itab-name& number: &itab-num&
/: else
Date:&itab-date& Name:&itab-name& number: &itab-num&
/:endif
PERIOD <<b>.</b>> IS NOT NECESSARY.
REGARDS
SHIBA DUTTA
Message was edited by:
SHIBA DUTTA
‎2007 Apr 11 7:15 AM
hi,
i think
&itab-date& has the value '00000000'.
chk this.
Rgds
anver
‎2007 Apr 11 7:16 AM
JUST TRY LIKE THIS
/: if &itab-date(C)& EQ '00000000'
Date: Name:&itab-name& number: &itab-num&
/: else
Date:&itab-date& Name:&itab-name& number: &itab-num&
/:endif
PERIOD <<b>.</b>> IS NOT NECESSARY.
REGARDS
SHIBA DUTTA
Message was edited by:
SHIBA DUTTA
‎2007 Apr 11 7:19 AM
Hi Shiba,
Thanks for your quick reply. What is the meaning of <b> C </b> in if &itab-date(C)& EQ '00000000'
Thanks
Ravi
‎2007 Apr 11 7:20 AM
GENERALLY IT IS CONDENSE THE SPACE YOU CAN WRITE WITHOUT (C) ALSO.
REGARDS
SHIBA DUTTA
‎2007 Apr 11 7:18 AM
Hi Ravi,
Can you please do the syntax check for the SAP Script.
SE71 -- open form in change mode --> FORM -- Check.
Check both the definition and text of the form.
You are getting two lines because, there might be some syntax error in the form due to which sometimes the IF and ENDIF conditions like this do not work.
Please do the systax checka and resolve incase any issue. The data will be printed correctly.
Reward if helpful.
Regards,
Shahu
‎2007 Apr 11 7:18 AM
Hi try out like this .
Define &mydate&
&mydate& = &itab-date&
if not &mydate& is initial
Date:&itab-date& Name:&itab-name& number: &itab-num&
else
Date: Name:&itab-name& number: &itab-num&
endif.