cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice rows in SAPSscript

former_member586438
Participant
0 Kudos

Hi

I'm trying to get the invoice rows to print in a new SAPScript form

In the main window I'm doing a Perform to a new ZProgram

After the Endperform I put in /E ZELEMENT and then the fields that are used in the ZProgram * &IT-WRBTR&

In the program I call the functions 'open-form,write-form,and close-form' ,but no output in SAPScript.

Can someone please give me some advise

Many thanks

Gerhard

Edited by: Gerhard Odendaal on Aug 29, 2011 12:50 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The use of /E ELEMENT_NAME is to allow the driver program to decide when to output a block of data. Since the driver program probably never passes the element in an FM call, you're not creating a situation in which the output would print. If you're doing this in a PERFORM in your SAPScript, you would do the Perform in the window where you want the data to appear, like:

/: perform my_routine in program my_subroutine_pool

/: using &variable&

/: using &....however many inputs you need....

/: changing &newvar&

/: changing &....however many outputs you need.

/: ENDPERFORM

&NEWVAR& "would output your data.

you would have a routine then with

form my_routine table in_par structure itcsy

out_par structure itcsy.

read in_par...index 1.

in_par-value would contain the value of the first "USING"

etc.

do the logic to produce the new variable..

Read table out_par index 1.

out_par-value = value of the first new output variable you named etc.

modify out_par.

..etc.

On the other hand, if you're doing this and creating an internal table in your driver, look at the SAP driver programs....mimic their function call passing the element name to the SAPScript....followed by write_form passing the data variable.

former_member586438
Participant
0 Kudos

Hi Dave

I was not aware that I cant use the write_form function if its called from the PERFORM statement's program

I will try and change driver

Many thks

Gerhard

Answers (0)