Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

difficulty in passing the parameter value 'BPA' to partner

how are you...

I m facing one problem in passing the parametr id called 'BPA' to Partner.. so i m not able to get the result from the function modules...please tell me where i did make any mistakes..any suggestion code, will be great help of mine.. i have provided you the code...

thanking you...

FUNCTION Z_BP_GET_ADDRESS_EXIT.

*"----


""Local Interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCT

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR

*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL

*"----


IF CALLCONTROL-STEP = 'SELECT'.

DATA: PARA TYPE tpara-paramid VALUE 'BPA',

PARTNER TYPE BU_PARTNER,

ADDRESS TYPE BU_ADDSC,

T_ADD_NO TYPE STANDARD TABLE OF BAPIBUS1006_ADDRESSES_INT,

LINE TYPE SEAHLPRES,

ADD_NO_LINE TYPE BAPIBUS1006_ADDRESSES_INT.

GET PARAMETER ID PARA FIELD PARTNER.

  • MOVE '0000000061' TO PARTNER.

DATA: ES_BUT000 TYPE BUS000___I,

ES_BUT000_OLD TYPE BUS000___I,

ET_partner TYPE TABLE OF BAPIBUS1006_KEY.

CALL FUNCTION 'BUPA_ADDRESSES_GET'

EXPORTING

IV_PARTNER = PARTNER

  • IV_PARTNER_GUID =

  • IV_ADDRESS_TYPE =

  • IV_OPERATION =

  • IV_VALID_DATE = SY-DATLO

  • IMPORTING

  • EV_STANDARD_ADDRNUMBER =

  • EV_STANDARD_ADDRGUID =

  • EV_STANDARD_USED_INSTEAD =

TABLES

ET_ADDRESSES = T_ADD_NO

  • ET_ADDRESSES_ALL =

  • ET_RETURN =

.

LOOP AT T_ADD_NO INTO ADD_NO_LINE.

CALL FUNCTION 'BUA_ADDRESS_DESCRIPTION_GET'

EXPORTING

I_PARTNER = PARTNER

  • I_PARTNERGUID =

  • I_OPERATION =

I_ADDRNUMBER = ADD_NO_LINE-ADDRNUMBER

  • I_ADDRGUID =

  • I_BUT000 =

  • I_XMEMORY = ' '

  • I_XWA = ' '

  • I_VALDT = '00000000'

  • I_VALDT_SEL = '00000000'

  • I_VALDT_SEL_NAMES = SY-DATLO

IMPORTING

  • E_DESCRIPTION =

E_DESCRIPTION_STREET = ADDRESS

  • E_XSTANDARD =

  • E_XFIX =

  • E_DESCRIPTION_LONG =

  • E_ADDRNUMBER =

  • E_DESCRIP_STREET_WITH_NAME =

  • EXCEPTIONS

  • NO_ADDRESS_FOUND = 1

  • WRONG_PARAMETERS = 2

  • INTERNAL_ERROR = 3

  • DATE_INVALID = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CONCATENATE ADD_NO_LINE-ADDRNUMBER ADDRESS INTO LINE-STRING.

INSERT LINE INTO TABLE RECORD_TAB.

ENDLOOP.

CALLCONTROL-STEP = 'DISP'.

ENDIF.

ENDFUNCTION.

Tags:
Former Member
replied

Hi Naim,

Hope you remember me.

Please try this, I have modified your code.

Declare all the data before any event of search help exit.

FUNCTION Z_BP_GET_ADDRESS_EXIT.

*"----


""Local Interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCT

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR

*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL

*"----


<b>DATA: PARA TYPE tpara-paramid VALUE 'BPA',

PARTNER TYPE BU_PARTNER,

ADDRESS TYPE BU_ADDSC,

T_ADD_NO TYPE STANDARD TABLE OF BAPIBUS1006_ADDRESSES_INT,

LINE TYPE SEAHLPRES,

ADD_NO_LINE TYPE BAPIBUS1006_ADDRESSES_INT.

DATA: ES_BUT000 TYPE BUS000___I,

ES_BUT000_OLD TYPE BUS000___I,

ET_partner TYPE TABLE OF BAPIBUS1006_KEY.</b>

IF callcontrol-step EQ 'PRESEL'.

GET PARAMETER ID PARA FIELD PARTNER.

ENDIF.

IF CALLCONTROL-STEP = 'SELECT'.

  • MOVE '0000000061' TO PARTNER.

CALL FUNCTION 'BUPA_ADDRESSES_GET'

EXPORTING

IV_PARTNER = PARTNER

  • IV_PARTNER_GUID =

  • IV_ADDRESS_TYPE =

  • IV_OPERATION =

  • IV_VALID_DATE = SY-DATLO

  • IMPORTING

  • EV_STANDARD_ADDRNUMBER =

  • EV_STANDARD_ADDRGUID =

  • EV_STANDARD_USED_INSTEAD =

TABLES

ET_ADDRESSES = T_ADD_NO

  • ET_ADDRESSES_ALL =

  • ET_RETURN =

.

LOOP AT T_ADD_NO INTO ADD_NO_LINE.

CALL FUNCTION 'BUA_ADDRESS_DESCRIPTION_GET'

EXPORTING

I_PARTNER = PARTNER

  • I_PARTNERGUID =

  • I_OPERATION =

I_ADDRNUMBER = ADD_NO_LINE-ADDRNUMBER

  • I_ADDRGUID =

  • I_BUT000 =

  • I_XMEMORY = ' '

  • I_XWA = ' '

  • I_VALDT = '00000000'

  • I_VALDT_SEL = '00000000'

  • I_VALDT_SEL_NAMES = SY-DATLO

IMPORTING

  • E_DESCRIPTION =

E_DESCRIPTION_STREET = ADDRESS

  • E_XSTANDARD =

  • E_XFIX =

  • E_DESCRIPTION_LONG =

  • E_ADDRNUMBER =

  • E_DESCRIP_STREET_WITH_NAME =

  • EXCEPTIONS

  • NO_ADDRESS_FOUND = 1

  • WRONG_PARAMETERS = 2

  • INTERNAL_ERROR = 3

  • DATE_INVALID = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CONCATENATE ADD_NO_LINE-ADDRNUMBER ADDRESS INTO LINE-STRING.

INSERT LINE INTO TABLE RECORD_TAB.

ENDLOOP.

CALLCONTROL-STEP = 'DISP'.

ENDIF.

ENDFUNCTION.

<b>

Please reward points if it helps.</b>

Regards,

Amit Mishra

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question