Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to get data from deep structure

Former Member
0 Kudos

Hi all ,

I need help ,

Someone can teach me how to get data from deep structure ?

I want to get vendor data from BAPI 'ISIDE_SM_VENDOR_DETAILS_GET'

when I active debug mode I can get data like IT_ES_VMDATA-IT_BAPIAD1VL[1]-NAME

but I don't know how to code in abap ...

below is my source code , someone can teach me how to fix it ?

Thanks for your kindly ....

*/----


FORM GET_VENDOR_NAME USING P_LIFNR CHANGING P_NAME .

/---- venfor baip ISIDE_SM_VENDOR_DETAILS_GET -


/

DATA: WA_ISL_VENDOR TYPE ISI_SM_SEL_RECORD ,

IT_ISL_VENDOR LIKE WA_ISL_VENDOR ,

WA_VMDATA TYPE ISI_VMDATA ,

IT_VMDATA LIKE WA_VMDATA ,

WA_RETURN TYPE ISI_BAPIRETURN1_TT ,

IT_RETURN LIKE WA_RETURN ,

"--

ET_RETURN LIKE WA_RETURN ,

WA_ISI_VMDATA TYPE ISI_VMDATA ,

IT_ES_VMDATA LIKE WA_ISI_VMDATA .

*/---

DATA : D_NAME LIKE WA_ISI_VMDATA-IT_BAPIAD1VL .

IT_ISL_VENDOR-LIFNR = P_LIFNR .

CALL FUNCTION 'ISIDE_SM_VENDOR_DETAILS_GET'

EXPORTING

IT_RETURN = IT_RETURN

IS_SEL_VENDOR = IT_ISL_VENDOR

IS_VMDATA = IT_VMDATA

IMPORTING

ET_RETURN = ET_RETURN

ES_VMDATA = IT_ES_VMDATA .

D_NAME = IT_ES_VMDATA-IT_BAPIAD1VL .

ENDFORM .

*/----


1 REPLY 1

Former Member
0 Kudos

Hi all ,

I solved it ,

It just to define internal table with header line then use read tabile index 1 .



FORM GET_VENDOR_NAME USING P_LIFNR CHANGING P_NAME .
 DATA: IT_ISL_VENDOR LIKE ISI_SM_SEL_RECORD ,
       "--
       WA_VMDATA TYPE ISI_VMDATA ,
       IT_VMDATA LIKE WA_VMDATA ,
       "--
       WA_RETURN TYPE ISI_BAPIRETURN1_TT ,
       IT_RETURN LIKE WA_RETURN ,
       "--
       ET_RETURN LIKE WA_RETURN ,
       "--
       WA_ISI_VMDATA TYPE ISI_VMDATA ,
       IT_ES_VMDATA LIKE WA_ISI_VMDATA .

DATA : T_NAME TYPE ISI_VMDATA-IT_BAPIAD1VL WITH HEADER LINE .

IT_ISL_VENDOR-LIFNR = P_LIFNR .

CALL FUNCTION 'ISIDE_SM_VENDOR_DETAILS_GET'
    EXPORTING
    IT_RETURN          = IT_RETURN
    IS_SEL_VENDOR      = IT_ISL_VENDOR
      IS_VMDATA        = IT_VMDATA
 IMPORTING
   ET_RETURN           = ET_RETURN
   ES_VMDATA           = IT_ES_VMDATA .

   READ TABLE IT_ES_VMDATA-IT_BAPIAD1VL INTO T_NAME INDEX 1 .
   P_NAME = T_NAME-NAME .

 ENDFORM .

Edited by: TitusFang on Jan 25, 2011 2:47 AM