Skip to Content
avatar image
Former Member

Passing data from driver program to sapscript form

Hi all,

I have a doubt regarding passing data from driver program to the sapscript form.

Generally, the datas we wanted to display for a particular text element in the form, we will generate it in an internal table in the

driver program. Finally,we need to pass this internal table to the form through some function module. When i searched the

standard driver program(eg: sapfm06p) i am not able to find how the internal table is passed. Can you please suggest, what is the

logic behind this(ie to pass data from driver program into the form.

Regards,

Mani

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 20, 2008 at 02:03 PM

    Hi,

    Goto sapfm06p , put write_form in the gobal search (main program), you will find the text elements will be passed to sap scripts on basis of window.

    this is the way you can transfer data from print program to scipts.

    sample code:

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'NEXTPAGE'

    WINDOW = 'NEXTPAGE'

    EXCEPTIONS

    OTHERS = 01.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'REFERENCE'

    WINDOW = 'REFERENC'

    EXCEPTIONS

    OTHERS = 01.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'HEADER_DELADDRESS'

    WINDOW = 'CONSGNEE'

    EXCEPTIONS

    OTHERS = 01.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'HEADER_DATES'

    WINDOW = 'DELDATE'

    FUNCTION = 'APPEND'

    EXCEPTIONS

    OTHERS = 01.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Mani,

      You ask an interesting question, and you probably deserve a better answer than I'm about to give.

      The documentation on SAPscript refers to the 'SAPscript composer' which is essentially invoked by SAPscript function modules (OPEN_FORM etc) and manages the overall form. Your question could equally ask how when you call WRITE_FORM you don't need to specify the form name, it is the SAPscript composer that manages this sequence of function modules and the data in the calling program.

      However, I can't give you a transaction code where you can look at the SAPscript composer, probably the nearest you'll get to it is the SAPscript debugger.

      As the SAP help says "The SAPscript composer is invisible on the outside".

      Very enigmatic.

      Regards,

      Nick

  • avatar image
    Former Member
    Feb 20, 2008 at 02:03 PM

    Hi,

    In evry Driver program we have a form ENTRY_NEW, if you look at the Program sapfm06p you will find the form also, whatever you declare the variables before this form those data will be avialble in the Layout automatically, because those variables will be Global and we can use directly in the Layout, no need to pass the variables to the Layout because this Layout will be called after these declarations

    Regards

    Sudheer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2008 at 03:36 PM

    Hi Mani,

    See the Code Below:

    Inside SE38 Driver Program:

    Loop at Itab into wa.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'NEXTPAGE'

    WINDOW = 'NEXTPAGE'

    EXCEPTIONS

    OTHERS = 01.

    Endloop.

    Inside SAP Script:

    /E NEXTPAGE

    &wa-f1&

    &wa-f2&

    &wa-f3&

    CONCEPT BEHIND:

    After the Loop statement, when it encounters the Write form it will search for the Text Element 'NEXTPAGE' in the SAP Script form. Now the values in the workarea will be visible in the form and it gets printed when we specify the particulat field in between &&.

    please REWARD Points if useful.

    Thanks,

    Karthik

    Add comment
    10|10000 characters needed characters exceeded