Skip to Content
1
Former Member
Jul 24, 2007 at 02:23 AM

Re:Urgent

45 Views

Hi,

Before PGI i need to insert the DO number , SO,PO,Kbetr(unit price)(all at item level) but GDPW (at header level) into my customised table ZSOTEXT -


> we can see all these in vl03n ,

click on header , then tab Texts -


> these r present below Txt ty , plz tell in which base tables these values are stored

i have written this below program, if iam trying to execute ZSDSO(customised table)

with DO number , iam getting No table entries found for specified key

plz any one help me in modifying the logic

TABLES: ZSDSO,

VBUK,

LIKP,

LIPS,

VBAK,

KONV,

VBPA,

MKPF,

LFA1.

DATA: BEGIN OF V_ZSDDOINFO OCCURS 0.

INCLUDE STRUCTURE ZSDSOTEXTINFO .

DATA: END OF V_ZSDDOINFO.

INITIALIZATION .

*----


AT SELECTION-SCREEN.

START-OF-SELECTION.

SELECT distinct XBLNR into v_xblnr FROM MKPF

where BLART = 'WL' AND XBLNR IN S_VBELN.

SELECT * FROM VBUK

WHERE VBELN = v_xblnr.

IF SY-SUBRC EQ 0.

SELECT single * FROM LIKP

WHERE VBELN = v_xblnr.

MOVE LIKP-VBELN TO H_OBJ.

PERFORM READ_TEXT USING 'Z038' 'E' H_OBJ 'VBBK'.

READ TABLE T_TLINE INDEX 1.

MOVE T_TLINE-TDLINE TO V_ZSDDOINFO-ZGDPW.

CLEAR T_TLINE.

REFRESH T_TLINE.

DATA: V_VBELV LIKE VBFA-VBELV.

DELETE T_TLINE WHERE TDLINE = SPACE.

IF NOT T_TLINE[] IS INITIAL.

READ TABLE T_TLINE INDEX 1.

MOVE T_TLINE-TDLINE TO V_ZSDDOINFO-ZCUSTPONO.

ELSE.

SELECT SINGLE VBELV INTO V_VBELV

FROM VBFA

WHERE VBELN = H_OBJ AND VBTYP_N = 'J'.

SELECT SINGLE BSTKD INTO V_ZSDDOINFO-ZCUSTPONO

FROM VBKD

WHERE VBELN = V_VBELV.

ENDIF.

CLEAR T_TLINE.

REFRESH T_TLINE.

MOVE LIKP-KUNNR TO V_ZSDDOINFO-KUNNR.

MOVE LIKP-KUNAG TO V_ZSDDOINFO-KUNAG.

MOVE LIKP-VBELN TO V_ZSDDOINFO-VBELN.

SELECT SINGLE VGBEL INTO V_SO FROM LIPS

WHERE VBELN = LIKP-VBELN.

SELECT SINGLE * FROM VBPA

WHERE VBELN = V_SO AND PARVW = 'ZF'.

SELECT * FROM LIPS

WHERE VBELN = LIKP-VBELN AND CHARG NE SPACE.

CONCATENATE LIKP-VBELN LIPS-POSNR INTO V_OBJ.

PERFORM READ_TEXT USING 'Z020' 'E' V_OBJ 'VBBP'.

READ TABLE T_TLINE INDEX 1.

MOVE T_TLINE-TDLINE TO V_ZSDDOINFO-ZCUSTPONO.

PERFORM READ_TEXT USING 'Z031' 'E' V_OBJ 'VBBP'.

READ TABLE T_TLINE INDEX 1.

MOVE T_TLINE-TDLINE TO V_ZSDDOINFO-ZCUSTSONO.

PERFORM READ_TEXT USING 'Z021' 'E' V_OBJ 'VBBP'.

READ TABLE T_TLINE INDEX 1.

MOVE T_TLINE-TDLINE TO V_ZSDDOINFO-ZBILL.

MOVE LIPS-POSNR TO V_ZSDDOINFO-POSNR.

MOVE LIPS-CHARG TO V_ZSDDOINFO-ZCHARG.

MOVE LIPS-MATNR TO V_ZSDDOINFO-ZMATNR.

MOVE LIPS-VGBEL TO V_ZSDDOINFO-ZVGBEL.

MOVE LIPS-VGPOS TO V_ZSDDOINFO-ZVGPOS.

SELECT SINGLE KNUMV INTO V_KNUMV FROM VBAK

WHERE VBELN = LIPS-VGBEL.

SELECT SINGLE * FROM KONV

WHERE KNUMV = V_KNUMV AND KPOSN = LIPS-VGPOS

AND KSCHL = 'ZUP1' AND KBETR > 0.

IF SY-SUBRC EQ 0.

V_ZSDDOINFO-ZASP = KONV-KBETR / KONV-KPEIN.

ELSE.

MOVE '0' TO V_ZSDDOINFO-ZASP.

ENDIF.

APPEND V_ZSDDOINFO.

ENDSELECT.

ENDIF.

ENDSELECT.

DELETE ADJACENT DUPLICATES FROM V_ZSDDOINFO COMPARING ALL FIELDS.

LOOP AT V_ZSDDOINFO.

SELECT * FROM ZSDSOTEXTINFO

WHERE VBELN = V_ZSDDOINFO-VBELN.

IF SY-SUBRC EQ 0.

DELETE V_ZSDDOINFO.

ENDIF.

ENDSELECT.

ENDLOOP.

INSERT ZSDSO FROM TABLE V_ZSDDOINFO.

END-OF-SELECTION.

&----


*& Form READ_TEXT

&----


  • text

----


  • -->P_0243 text *

  • -->P_0244 text *

  • -->P_H_OBJ text *

  • -->P_0246 text *

----


FORM READ_TEXT USING P_ID LIKE THEAD-TDID

P_LAN LIKE THEAD-TDSPRAS

P_NAME LIKE THEAD-TDNAME

P_OBJ LIKE THEAD-TDOBJECT.

REFRESH T_TLINE. CLEAR T_TLINE.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = P_ID

LANGUAGE = P_LAN

NAME = P_NAME

OBJECT = P_OBJ

  • ARCHIVE_HANDLE = 0

  • IMPORTING

  • HEADER =

TABLES

LINES = T_TLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

ENDFORM. " READ_TEXT