Skip to Content
author's profile photo
Former Member

Error Regarding Fetching Address

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 05:48 PM

    Check the below code and try now :

    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'.

    if sy-subrc eq 0.

    LV_VBELN = IN_PAR_TAB-VALUE.

    <b>CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

    EXPORTING

    INPUT = LV_VBELN

    IMPORTING

    OUTPUT =LV_VBELN.</b>

    endif.

    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

    use sy-subrc check always.

    Thanks

    Seshu

    Add comment
    10|10000 characters needed characters exceeded