Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Script

Former Member
0 Likes
625

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
601

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

6 REPLIES 6
Read only

anversha_s
Active Contributor
0 Likes
601

hi,

i think

&itab-date& has the value '00000000'.

chk this.

Rgds

anver

Read only

Former Member
0 Likes
602

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

Read only

0 Likes
601

Hi Shiba,

Thanks for your quick reply. What is the meaning of <b> C </b> in if &itab-date(C)& EQ '00000000'

Thanks

Ravi

Read only

0 Likes
601

GENERALLY IT IS CONDENSE THE SPACE YOU CAN WRITE WITHOUT (C) ALSO.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
601

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

Read only

Former Member
0 Likes
601

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.