on 10-16-2008 4:51 AM
Hello SD Consultant,
I am an ABAPer
I want to print the sales text maintained in material master data to my invoice.
which field and table i need to refer to fetch the data?
Please help me to solve this problem ASAP.
Priyank Choubey
Hi
Priyank Chobey
You can use table MARA -- MAKTX or
u can use structure VBDPR -- ARKTX This is the what is maintain in the sales text of material.
Hope this will help you
FORM GET_SALES_TEXT.
DATA : WID LIKE THEAD-TDID VALUE '0001',
WOBJECT LIKE THEAD-TDOBJECT VALUE 'MVKE',
WLANG LIKE THEAD-TDSPRAS,
WNAME LIKE THEAD-TDNAME.
WLANG = SY-LANGU.
WNAME = TVBDPR-MATNR.
WRITE: VBRK-VKORG TO WNAME+18.
WRITE: VBRK-VTWEG TO WNAME+22.
REFRESH IT_LINES.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = WID
LANGUAGE = WLANG
NAME = WNAME
OBJECT = WOBJECT
ARCHIVE_HANDLE = 0
IMPORTING
HEADER =
TABLES
LINES = IT_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE IT_LINES INDEX 1.
IF SY-SUBRC EQ 0.
WARKTX = IT_LINES-TDLINE+0(32).
WARKTX1 = IT_LINES-TDLINE+0(80).
DELETE IT_LINES INDEX 1.
ENDIF.
CLEAR WARKTX2.
IF VBDKR-SPART EQ 'CB' OR VBDKR-SPART EQ 'SU'.
READ TABLE IT_LINES INDEX 1.
IF SY-SUBRC EQ 0.
WARKTX2 = IT_LINES-TDLINE+0(80).
ENDIF.
ELSEIF VBDKR-SPART EQ 'SC'.
ELSE.
WARKTX2 = WARKTX1+32.
ENDIF.
ENDFORM. " GET_SALES_TEXT
Thx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.