Application Development 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: 

Need help in SAPSCRIPT for layout F140_DOCU_EXC_01

Former Member
0 Kudos

Hi,

We are using following print program RFKORD50 and made a copy of standard layout 'F140_DOCU_EXC_01'

We wish to show multiple items in main window. And we have put BSEG-BUZEI, BSEG-ZUONR, SGTXT and DMBTR fields in main window and document no in another INFO window at top.

However multiple items are not being displayed.

Need some idea on how to solve this.

Thanks,

Shreyas

Helpful answers will be rewarded.

1 REPLY 1

Former Member
0 Kudos

Hi,

write the Perform in the main window ...in the form and endform write your logic .. the field values which you want in the Program you can get by this Performs .. so in the changing field contains the values you want in the Script .. so if you write this perform in the main window you will get the values cause this main window will be there in the loop ..

if you want a field in the header or in some other window .. write the same i mean write in another perfoem in that window .. so that will appear in te layout

to write the logic :

in the script:

/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORM

INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:

FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.

...
ENDFORM.

The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.

The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.

From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.

Definition in the SAPscript form:


/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/

/ &BARCODE&

 

Coding of the calling ABAP program:

REPORT QCJPERFO.

 

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number 
NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY ‘PAGE’.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.

READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = ‘|’. "First page 
ELSE.
OUT_PAR-VALUE = ‘||’. "Next page 
ENDIF.

IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = ‘L’. "Flag: last page

ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

 

ENDFORM.

Thanks

Sudheer