2008 May 02 10:07 AM
Hi,
One of my requirement to display the material description in the layout(BSEG-SGTXT) .This will be picked up from the line item text of invoice document.How to get the materail description?Plesase help me.
Regards,
Srihitha
Hi,
One of my requirement to display the material description in the layout(BSEG-SGTXT) .This will be picked up from the line item text of invoice document.How to get the materail description?Plesase help me.
Regards,
Srihitha
2008 May 02 10:09 AM
2008 May 02 10:13 AM
2008 May 02 10:13 AM
there is a function module for that READ_TEXT.....below is code go through it
DATA: wa_ltext TYPE tline,
current_line TYPE i,
prev_line TYPE i.
LOOP AT ta_ltext WHERE tdline NE space.
CASE ta_ltext-tdformat.
WHEN '='.
prev_line = sy-tabix - 1.
READ TABLE ta_ltext INTO wa_ltext INDEX prev_line.
IF sy-subrc = 0.
CONCATENATE wa_ltext-tdline ta_ltext-tdline
INTO ta_ltext2-tdline.
MODIFY ta_ltext2 INDEX current_line.
ENDIF.
WHEN OTHERS.
ta_ltext2-tdline = ta_ltext-tdline.
APPEND ta_ltext2.
current_line = sy-tabix.
ENDCASE.
ENDLOOP.
-
DATA: BEGIN OF ttab OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF ttab.
DATA: BEGIN OF tinlinetab OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF tinlinetab.
DATA: BEGIN OF thead.
INCLUDE STRUCTURE thead.
DATA: END OF thead.
lv_objname = it_lips-posnr.
CONCATENATE it_lips-vbeln lv_objname INTO lv_objname.
PERFORM read_item_text1 USING lv_objname it_lips-vbeln.
&----
*& Form read_item_text1
&----
text
----
-->P_LV_OBJNAME text
-->P_IT_LIPS_VBELN text
----
FORM read_item_text1 USING P_OBJNAME
P_IT_LIPS_VBELN.
CLEAR : v_regcarr , v_intcarr ,
v_reqdate , v_commdate.
CLEAR: thead,it_likp-traty.
REFRESH : ttab, tinlinetab.
thead-tdid = '0001'.
thead-tdspras = sy-langu.
thead-tdname = p_objname.
thead-tdobject = 'VBBP'.
CALL FUNCTION 'READ_TEXT_INLINE'
EXPORTING
id = thead-tdid
inline_count = 1
language = thead-tdspras
name = thead-tdname
object = thead-tdobject
IMPORTING
header = thead
TABLES
inlines = tinlinetab
lines = ttab
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
rewards please if satisfied
2008 May 02 10:24 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |