cancel
Showing results for 
Search instead for 
Did you mean: 

regarding passing table array to sap scripts - urgent

aaruljothi
Participant
0 Kudos

Hi Experts,

I am calling an SAP Script form from a custom program. The code snippet is as follows:

*****************************************************************************************

MOVE : 'ZFRM_EX_COM_INV' TO w_form.

PERFORM open_form USING w_form.

PERFORM write_form USING 'MAIN' 'HEADER'.

PERFORM write_form USING 'MAIN' 'LINE_ITEM'.

LOOP AT it_cond INTO wa_cond.

<b>PERFORM write_form USING 'TOTAL' 'TOTAL_COND'.</b>

<i> " TOTAL is the page window and TOTAL_COND is the element.</i>

ENDLOOP.

PERFORM close_form.

&----


*& Form write_form

&----


  • text

----


  • -->VAR1 text

----


FORM write_form USING var1 var2.

IF var2 IS INITIAL.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = var1

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

OTHERS = 8.

ELSE.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = var2

window = var1

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

OTHERS = 8.

ENDIF.

ENDFORM. " WRITE_FORM

*****************************************************************************************

In the text that is in bold in teh code snippet, I am tring to pass the values one-by-one and print in the output.

But only the last line item from that table is begining printed. The other lines are overwritten by the last line.

How should I display all the lines in the internal table it_cond.

Please help me...

regards,

arul jothi a.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

U are using a variable window to print the 'total_cond' text element..

so whenever u call the write form for a variable window .. it will get over written by the current contents.. I t wont append the contents to the form...

Instead u use this text element in the MAIN window then onli u will get all the data..

i hope this is the problem..

reward if it helps u...

sai ramesh

aaruljothi
Participant
0 Kudos

Hi Sai,

Thankx for your reply.

I cannot use this elements in the MAIN window because, the MAIN window is graphically situated in a different place and with different contents.

Please give me another possible solution.

Regards,

Arul Jothi A

Former Member
0 Kudos

then in the WRITE_FORM of the window TOTAL for the parameter FUNCTION pass the value as 'APPEND' instead of 'SET'.