cancel
Showing results for 
Search instead for 
Did you mean: 

Credit Memo print

Former Member
0 Kudos

Hi,

I need to print the long text after Dear Sir/ Madam in credit memo sap script.i wrote the driver program for the text. But where it should be called?.. I mean in which element..

I am unable to understand as there are many elements in text editor of credit memo..

Can anyone have idea??...Please suggest me how to proceed..

Thanks

Sri

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If your text is a hardcoded text, You can create a standard text using t-code SO10 and you can call the text in your script using the statement "INCLUDE z_text OBJECT TEXT ID ST LANGUAGE EN".

If you need to get the text's maintained for the credit/debit memo's i.e. if ur using VF03 t-code the texts normally come from the MEMO's directly you cn call them using "INCLUDE &TVBDPR-TDNAME& OBJECT VBBP ID 0001".You can read the text using the FM read_text.

If you have already used READ_TEXT FM in your driver pgm n you want to pass the text in your script you need to go for subroutines inside ur script.For eg:

/: PERFORM GET_TEXT IN PROGRAM 'ZPROGRAM'

/: USING &EKPO-EBELN&

/: USING &EKPO-EBELP&

/: CHANGING &DESC&

/: ENDPERFORM .

In your driver program you can call this subroutine in the following manner.

FORM get_text TABLES in_var STRUCTURE itcsy

out_var STRUCTURE itcsy.

DATA:lv_name1(10) TYPE c,

lv_name2(6) TYPE c,

lv_name TYPE thead-tdname,

tb_item_text LIKE tline OCCURS 0 WITH HEADER LINE.

READ TABLE in_var INDEX 1.

lv_name1 = in_var-value.

READ TABLE in_var INDEX 2.

lv_name2 = in_var-value.

CONCATENATE lv_name1 lv_name2 INTO lv_name.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'F01'

language = 'E'

name = lv_name

object = 'EKPO'

TABLES

lines = tb_item_text

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

IF NOT tb_item_text[] IS INITIAL.

READ TABLE tb_item_text INDEX 1.

ENDIF.

READ TABLE out_var INDEX 1.

out_var-value = tb_item_text-tdline.

MODIFY out_var INDEX 1.

ENDFORM.

The text will go into the changing parameter DESC.You can directly print this DESC as &DESC& where ever you need in the script.

Regards,

Chandra.

Edited by: Chandra A on Mar 23, 2009 9:35 AM

Edited by: Chandra A on Mar 23, 2009 9:36 AM

Former Member
0 Kudos

Hai sri,

You have to use perform statement in script and pass the value to the driver pgm and get the long text in script by using include statement..

Regards