cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass text from print program to SAPSCRIPT

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

That should work also..

IF CUSTOMER = 'R'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'TEXTELEMENT'

WINDOW = 'NEWWINDOW'

ENDIF.

Thanks,

Naren

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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