Skip to Content
avatar image
Former Member

How to pass text from print program to SAPSCRIPT

Hi Friends ,

I need to print this 4 line text on the invoice form between the INFO window and MAIN window . I created a new window in the form and included the text . using include command . The requirement is that if a certain condition is met in the print program then only this 4 line text should be printed on the form .

Any suggestions .

Thank you ,

Hari

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Nov 28, 2006 at 10:23 PM

    Hi,

    Set a flag V_FLAG = 'X' if the condition is satisfied..

    Before using the INCLUDE in the sap script check if the flag V_FLAG = 'X'..

    Thanks,

    Naren

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Naren ,

      Just to verify .

      I need to define something like this below in the print program ?

      data : v_flag type c .

      If customer = 'R' .

      v_flag = 'X'.

      PERFORM WRITE_FORM.

      endif.

      -


      In the SAPFORM I defined a new var window "ADD_TEXT"

      IF v_flag = 'X'.

      INCLUDE Z_TEXT OBJECT TEXT ID ST LANGUAGE ES PARAGRAPH EE

      ENDIF.

      -


      Please let me know if it is correct and also about the write_form . What paramenters do i pass in the write_form ????

      Thanks for your help .

      Hari

  • avatar image
    Former Member
    Nov 28, 2006 at 10:52 PM

    Hi,

    I believe you don't have to call using WRITE_FORM FM...I believe the window will be called by default if you don't have any text element in it..

    I added the & symbol at the begining and end of the symbol..

    -


    In the SAPFORM I defined a new var window "ADD_TEXT"

    IF <b>&</b>v_flag<b>&</b> = 'X'.

    INCLUDE Z_TEXT OBJECT TEXT ID ST LANGUAGE ES PARAGRAPH EE

    ENDIF.

    -


    Thanks,

    Naren

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Naren ,

      I have done something like this . Let me know if it will work .

      WHEN CUSTOMER = 'R'

      PERFORM WRITE_FORM 'NEWWINDOW' 'TEXT ELEMENT' 'APPEND ' 'BODY'

      END CASE

      In the form I will have in the NEWWINDOW .

      /E TEXTELEMENT

      /: INCLUDE Z_TEXT OBJECT TEXT ID ST LANGUAGE FR PARAGRAPH LV

      Thanks again ,

      Hari

  • avatar image
    Former Member
    Nov 28, 2006 at 11:40 PM

    Hi,

    That should work also..

    IF CUSTOMER = 'R'.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'TEXTELEMENT'

    WINDOW = 'NEWWINDOW'

    ENDIF.

    Thanks,

    Naren

    Add comment
    10|10000 characters needed characters exceeded