cancel
Showing results for 
Search instead for 
Did you mean: 

printing the local variables in sap script

Former Member
0 Kudos

Hi all,

When i am trying to print the workarea content which is declared in a custom report, null value

is printed. when I write &wa_mara-matnr& in text element(/E) of the form and try to check

a message " unknown variable wa_mara-matnr" is shown in syntax errors,though i declared the

workarea in the report.Thanks in advance.

Sri Suktha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks all,

My problem is resolved.

Former Member
0 Kudos

Hi Srisuktha,

I think you are putting your work area variable name in the same row of the text element (/E)declaration.

Due to which it is considering "wa_mara-matnr" as a text element and giving the error.

You are supposed to put it in the row of paragraph format.

Try debugging and check.

There is no other reason why it should not be passed. Your approach otherwise seems perfect.

Former Member
0 Kudos

Hi,

try like below:

In Print Program:

LOOP AT it_mara INTO wa_mara.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM'

window = 'MAIN'

EXCEPTIONS

OTHERS = 1.

ENDLOOP.

In Script: In MAIN Window, in Text Elements add the below code:

/E ITEM

P1 &wa_mara-matnr&

/E - Element

P1 - Paragraph Format.

Hope it helps!!

Rgds,

Pavan

Former Member
0 Kudos

Hi,

In order to get the values in the prinout u need to write a routine in the script with in perform and end perform ,with that get the values inside the script and present it in the output.

If u have any queries kindly revert.

Cheers,

Joe