on 07-18-2008 4:38 PM
Hi All
I wrote a code so as to get the phone number of the Business partner displayed in the smart form , but it shows me the phone number of the previous Business patner which has being end dated .
let me knw wht changes do i make to reflect the phone number of the current BP in use .
like i have Two BP's , one has already being end dated and the second one is in the current period, i want the phone number of the current Bp.
What additional code i need to add please suggest ????
CALL FUNCTION 'API_RE_CN_GET_DETAIL'
EXPORTING
id_bukrs = contract-bukrs
id_recnnr = contract-recnnr
IMPORTING
et_partner = t_et_partner
EXCEPTIONS
error = 1
OTHERS = 2.
IF NOT t_et_partner[] IS INITIAL.
LOOP AT t_et_partner INTO w_et_partner WHERE role = 'Z00016'.
w_partner = w_et_partner-partner.
EXIT.
ENDLOOP.
CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL'
EXPORTING
businesspartner = w_partner
valid_date = sy-datlo
TABLES
bapiadtel = t_bapiadtel.
LOOP AT t_bapiadtel INTO w_bapiadtel.
CONCATENATE '('
w_bapiadtel-telephone(3)
')'
w_bapiadtel-telephone+3(3)
'-'
w_bapiadtel-telephone+6(4)
INTO w_contact_num.
EXIT.
ENDLOOP.
ENDIF.
Early response is appreciated .
Thanks
Shweta
Check the validity of dates. Change your loop to:
LOOP AT t_et_partner INTO w_et_partner
WHERE role = 'Z00016'
and VALIDFROM > SY-DATUM
and VALIDTO < SY-DATUM.
w_partner = w_et_partner-partner.
EXIT.
ENDLOOP.
.
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.