Application Development and Automation 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: 
Read only

Sapscript Divisions

Former Member
0 Likes
2,213

Hello Gurus,

¿Do you know what is the meaning of the content in the red rectanble?, how does it Works?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,142

Hi Enrique,

  * As in like Reports,We cannot use LOOP Statements in Script forms.So,Instead we use Text                 Elements to loop the data from internal table which is being passed from Driver program.

  * /E is the SAP Script form TAG Columns..It is used to Represent Text Elements.

    For Example:

    /E ELE

        &wa-f1& &wa-f2& ....

    /E ELE2

        &wa2-f1& &wa2-f2&

   * Here ELE , ELE2 are Text Elements...

   * After This ,we need to pass the text elements to WRITE_FORM Function module in the driver                program

CALL FUNCTION 'WRITE_FORM'

       EXPORTING

         element  = 'ELE'

         function = 'SET'

         type     = 'BODY'

         window   = 'MAIN'

* IMPORTING

*       PENDING_LINES                  =

* EXCEPTIONS

*       ELEMENT  = 1

*       FUNCTION = 2

*       TYPE     = 3

*       UNOPENED = 4

*       UNSTARTED                      = 5

*       WINDOW   = 6

*       BAD_PAGEFORMAT_FOR_PRINT       = 7

*       SPOOL_ERROR                    = 8

*       CODEPAGE = 9

*       OTHERS   = 10

       .

     IF sy-subrc <> 0.

* Implement suitable error handling here

     ENDIF.

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

NOTE : If you want to access internal table values in the script form you have to call WRITE_FORM

            With in LOOP of that particular internal table.

Hope you understand...


Regards,

    

      Rohan



7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,142

Look for "Windows and Text Elements" in online help.

Text Element

Now analyze the driver program.

Regards,

Raymond

Read only

Former Member
0 Likes
2,142

Is text element. You can call it in program driver for example with the follow instruction: PERFORM w_f USING 'WERVSMAT' 'SET' 'MAIN'. "main is window

Read only

Former Member
0 Likes
2,142

Elements are used to group a related information to print in the script. Sample code in your driver program to call the specified element:


CALL FUNCTION 'WRITE_FORM'                

     EXPORTING                            

          ELEMENT = 'NEXTPAGE'            

          WINDOW  = 'NEXTPAGE'            

     EXCEPTIONS                           

          OTHERS  = 01.                   

  CALL FUNCTION 'WRITE_FORM'              

       EXPORTING                          

            ELEMENT = 'REFERENCE'         

            WINDOW  = 'REFERENC'          

       EXCEPTIONS                         

            OTHERS  = 01.      

Read only

Former Member
0 Likes
2,143

Hi Enrique,

  * As in like Reports,We cannot use LOOP Statements in Script forms.So,Instead we use Text                 Elements to loop the data from internal table which is being passed from Driver program.

  * /E is the SAP Script form TAG Columns..It is used to Represent Text Elements.

    For Example:

    /E ELE

        &wa-f1& &wa-f2& ....

    /E ELE2

        &wa2-f1& &wa2-f2&

   * Here ELE , ELE2 are Text Elements...

   * After This ,we need to pass the text elements to WRITE_FORM Function module in the driver                program

CALL FUNCTION 'WRITE_FORM'

       EXPORTING

         element  = 'ELE'

         function = 'SET'

         type     = 'BODY'

         window   = 'MAIN'

* IMPORTING

*       PENDING_LINES                  =

* EXCEPTIONS

*       ELEMENT  = 1

*       FUNCTION = 2

*       TYPE     = 3

*       UNOPENED = 4

*       UNSTARTED                      = 5

*       WINDOW   = 6

*       BAD_PAGEFORMAT_FOR_PRINT       = 7

*       SPOOL_ERROR                    = 8

*       CODEPAGE = 9

*       OTHERS   = 10

       .

     IF sy-subrc <> 0.

* Implement suitable error handling here

     ENDIF.

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

NOTE : If you want to access internal table values in the script form you have to call WRITE_FORM

            With in LOOP of that particular internal table.

Hope you understand...


Regards,

    

      Rohan



Read only

0 Likes
2,142

Thanks for answer, I understand your reply, but I dont understand the sapscript I haven been given, all start at MB90 to print MIGO, I fill the required fields finally run the report and it jumps to a text element, I dont know how it jumps. I attach the images.

Read only

0 Likes
2,142

already answered it before! Sapscript elements are called with a specific order expressed in the printing program which retrieve data and manage the sapscript itself.

Check out My first SAP Script step by step - ABAP Development - SCN Wiki

or

SAPscript - ABAP Development - SCN Wiki

Read only

0 Likes
2,141

Thanks for all the answer, I did this:

1) Went to table TNAPR and got the program driver SAPM07DR,

2) I debug the program and I found the text element  WE3VERBRMAT I was looking for, it's in hardcode