Skip to Content
0
Former Member
Jul 31, 2007 at 09:20 AM

smartform related doubt

23 Views

hi friends, i have a problem in smartform for extracting the data from more than two tables i wrote code but it will not extracting the data can any one help me in this situation, if possible correct code and give me reply as early as possible.

I am sending you the code please check it once.

SELECT

vbeln

stceg

FROM vbrk INTO TABLE i_vbrk WHERE vbeln = p_vbeln.

IF NOT i_vbrk[] IS INITIAL.

SELECT

vbeln

vgbel

FROM vbrp INTO TABLE i_vbrp WHERE vbeln = i_vbrk-vbeln.

IF NOT i_vbrp[] IS INITIAL.

SELECT

vbeln

FROM

likp INTO TABLE i_likp WHERE vbeln = i_vbrp-vgbel.

IF NOT i_likp[] IS INITIAL.

SELECT

parnr

FROM vbpa INTO TABLE i_vbpa WHERE vbeln = i_likp-vbeln.

IF NOT i_vbpa[] IS INITIAL.

SELECT

kunnr FROM kna1 INTO TABLE i_kna1 WHERE kunnr = i_vbpa-kunnr.

IF NOT i_kna1[] IS INITIAL.

SELECT

kunnr

FROM knkk INTO TABLE i_knkk WHERE kunnr = i_kna1-kunnr.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

******************************

*this is for item information

******************************

SELECT

matnr

mfrpn

eannr

FROM mara INTO TABLE i_mara WHERE matnr = i_mara-matnr.

IF NOT i_mara[] IS INITIAL.

SELECT

matnr

maktx

FROM makt INTO TABLE i_makt WHERE matnr = i_mara-matnr.

IF NOT i_makt[] IS INITIAL.

SELECT

matnr

stawn

herkl

FROM marc INTO TABLE i_marc WHERE matnr = i_makt-matnr.

IF NOT i_marc[] IS INITIAL.

SELECT

matnr

vbeln

fkimg

FROM vbrp INTO TABLE i_vbrp WHERE matnr = i_mara-matnr.

IF NOT i_vbrp[] IS INITIAL.

SELECT

vbeln

posnr

FROM vbpa INTO TABLE i_vbpa WHERE vbeln = i_vbrp-vbeln.

IF NOT i_vbpa[] IS INITIAL.

SELECT

vbeln

netpr FROM vbap INTO TABLE i_vbap WHERE vbeln = i_vbpa-vbeln.

ENDIF.

ENDIF.

ENDIF.

ENDIF.