Skip to Content
0
Former Member
Sep 28, 2007 at 05:22 PM

Error Regarding Fetching Address

19 Views

Hi,

Below code i am writing for fetching the address to print in my form. data is available in respective tables but am not getting the data with this code can any one let me know what is the problem with my code

Thanks & Regards

Munna

FORM F_GET_ADDRESS TABLES IN_PAR_TAB STRUCTURE ITCSY

OUT_PAR_TAB STRUCTURE ITCSY.

DATA : LV_VBELN LIKE VBDKA-VBELN,

LV_BUKRS LIKE T001-BUKRS,

LV_ADRNR LIKE T001-ADRNR,

LV_STREET LIKE ADRC-STREET,

LV_POST_CODE LIKE ADRC-POST_CODE1,

LV_CITY LIKE ADRC-CITY1,

LV_VKORG LIKE VBAK-VKORG.

.

READ TABLE IN_PAR_TAB WITH KEY NAME = 'VBDKA-VBELN'.

LV_VBELN = IN_PAR_TAB-VALUE.

SELECT SINGLE VKORG FROM VBAK INTO LV_VKORG

WHERE VBELN = LV_VBELN.

SELECT SINGLE BUKRS FROM TVKO INTO LV_BUKRS

WHERE VKORG = LV_VKORG.

SELECT SINGLE ADRNR FROM T001 INTO LV_ADRNR

WHERE BUKRS = LV_BUKRS.

SELECT SINGLE STREET POST_CODE1 CITY1 FROM ADRC INTO

(LV_STREET, LV_POST_CODE, LV_CITY) WHERE ADDRNUMBER = LV_ADRNR.

READ TABLE OUT_PAR_TAB WITH KEY NAME = 'GV_STREET'.

OUT_PAR_TAB-VALUE = LV_STREET.

MODIFY OUT_PAR_TAB INDEX SY-TABIX.

READ TABLE OUT_PAR_TAB WITH KEY NAME = 'GV_POST_CODE'.

OUT_PAR_TAB-VALUE = LV_POST_CODE.

MODIFY OUT_PAR_TAB INDEX SY-TABIX.

READ TABLE OUT_PAR_TAB WITH KEY NAME = 'GV_CITY'.

OUT_PAR_TAB-VALUE = LV_CITY.

MODIFY OUT_PAR_TAB INDEX SY-TABIX.

ENDFORM. "F_GET_ADDRESS