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: 

how the fields are related in print program and Form Text elements

Former Member
0 Kudos

Hi,

I am testing an Sapscript which is used to print Recieving Material Id tickets. We modify the Standard sap script LVSKOMMIL2. The form is same as Standard Form but in footer we added three more fields. I want to know how the print program is going to supply data to all these fields in form windows as i did'nt find the WRITE_FORM function in the print program.

4 REPLIES 4

Former Member
0 Kudos

HI,

Its not easy to find the Write_form for a standard driver program..

If you want to supply some data to the new window that you have added . rather then disturbing the driver program.. write your own program and write a subroutine in it and call it from with in the script window.

Check for this.

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

chk this sample code of driver program:

REPORT ZVKKSCRIPTS1 .

data: v_mat like mara-matnr,

var1 like makt-maktx.

form subroutine tables itab structure itcsy

otab structure itcsy.

read table itab with key name = 'IT_VBAP-MATNR'.

if sy-subrc = 0.

v_mat = itab-value.

select single maktx from makt into var1

where matnr = v_mat and

spras = sy-langu.

if sy-subrc = 0.

read table otab with key name = 'VAR1'.

if sy-subrc = 0.

otab-value = var1.

modify otab index sy-tabix.

endif.

endif.

endif.

endform.

if you still want to find out in the existing program.. just start at the sub routine ENTRY in the program and navigate accordingly

Thanks

Mahesh

0 Kudos

Thanks for Reply. But the problem is in the print program a separate routine is created to populate the additional fields in an internal table. In form window the fields are coded directly i mean itab1-zpartno, itab1-zpurchaseorder......

I doubt how it works. In general it has to work in the way which you explained in the example. But i want to know whether the form gonna display the additional fields if we coded directly like itab1-zpartno, itab1-zpurchaseorder...

0 Kudos

HI,

You have to give it as &itab-ponumber& ....

And remember its not necessary call a Write_form function module for each and every window.

Thanks

Mahesh

0 Kudos

Hi Mahesh,

the fields are defined in the same way as &itab-ponumber&. More over the internal table has to be of structure itcsy but how to send an internal table of our own type.