2012 Aug 14 12:43 PM
Hi,
I am using the BAPI ' BAPI_CUSTOMER_HIERARCHIE_INS' to insert Customer node.
the node is getting added but i am not getting any values in RETURN table.
Please help.
Thanks,
Rashmi
2012 Aug 14 12:49 PM
Hi Rashmi ,
Could You provide the code .
Regards ,
Yogendra Bhaskar
2012 Aug 14 12:56 PM
Hi,
Please find the code.
select single kunnr
ktokd
from kna1
into ls_kna1
where kunnr eq i_p_kunnr.
if sy-subrc eq 0.
ls_insert-customer = i_kunnr.
ls_insert-salesorg = i_vkorg.
ls_insert-distr_chan = c_01.
ls_insert-division = i_spart.
ls_insert-valid_from = sy-datum.
ls_insert-custhityp = c_a.
ls_insert-parent_customer = i_p_kunnr.
ls_insert-parent_sales_org = i_hvkorg.
ls_insert-parent_distr_chan = c_01.
ls_insert-parent_division = i_hspart.
ls_insert-valid_to = c_validto.
ls_insert-routine = c_z1.
ls_insert-rebate_rel = c_x.
ls_insert-pric_rel = c_x.
ls_insert-assign_hi = c_z2.
append ls_insert to lt_insert.
call function 'BAPI_CUSTOMER_HIERARCHIE_INS'
tables
node_list = lt_insert.
return = return.
This return has no value even if record is inserted.
Regards,
Rashmi
2012 Aug 14 1:08 PM
HI Rashmi,
I Found two mistakes in the code.
First: Missing Table Keyword in the Select Statement.
select single kunnr
ktokd
from kna1
into TABLE ls_kna1
where kunnr eq i_p_kunnr.
Second: BapiReturn is to be assigned to return parameter.
CALL FUNCTION 'BAPI_CUSTOMER_HIERARCHIE_INS'
RETURN = bapiret2.
Then only the two entries will be entered into the table.
2012 Aug 14 1:15 PM
hi Rashmi ,
Check for a wrong entry , if it returning error message , then its working fine .
regards ,
Yogendra Bhaskar
2012 Aug 14 12:53 PM
(FAQ) Not every BAPI returns success message, their only obligation is to return error and abort messages. They mostly return success message when a "number range" is involved (e.g. Document XXXX created/updated)
Ref. Return Parameters (Error Handling)
If the return parameter is not set or is set to an initial value this means that no error has occurred.Regards,
Raymond
2012 Aug 14 1:00 PM
Hiii,
Every BAPI not returns message for successful processing of data.
you can check if you put wrong code you will definitely get error see below code .
DATA : wa TYPE BAPIKNA1_KNVH_PROCESS.
DATA : BAPIKNA1_KNVH_PROCESS TYPE STANDARD TABLE OF BAPIKNA1_KNVH_PROCESS,
bapiret2 TYPE STANDARD TABLE OF bapiret2.
wa-SALESORG = 'ABCD'. " dummy
wa-CUSTOMER = '123456'. " dummy
APPEND wa to BAPIKNA1_KNVH_PROCESS.
CALL FUNCTION 'BAPI_CUSTOMER_HIERARCHIE_INS'
TABLES
NODE_LIST = BAPIKNA1_KNVH_PROCESS
RETURN = bapiret2.
.