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: 

XD02 BDC Update

sharprabs
Participant
0 Kudos

I am trying to update the tax details in xd02 BDC . The page down is not working.

Kindly help

SPAN {font-family: "Courier New";font-size: 10pt;color: #000000;background: #FFFFFF;}.L0S33 {color: #4DA619;}.L0S52 {color: #0000FF;}.L0S55 {color: #800080;}.L0S70 {color: #808080;}

perform bdc_field using 'BDC_CURSOR'
'KNVI-TAXKD(01)'.
perform bdc_field using 'KNVI-TAXKD(01)'
wa_tmp-taxk1.
perform bdc_field using 'KNVI-TAXKD(02)'
wa_tmp-taxk2.
perform bdc_field using 'KNVI-TAXKD(03)'
wa_tmp-taxk3.
perform bdc_field using 'KNVI-TAXKD(04)'
wa_tmp-taxk4.
perform bdc_field using 'KNVI-TAXKD(05)'
wa_tmp-taxk5.
perform bdc_field using 'KNVI-TAXKD(06)'
wa_tmp-taxk6.

perform bdc_dynpro using 'SAPMF02D' '7000'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_field using 'BDC_CURSOR'
'KNVI-TAXKD(06)'.

kindly help

Regards

Sharada

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Did you execute the recording (SHDB) with "Simulate Background Mode" and "Default size" set or did you analyze the dynpro/status during a call of XD02 to find a correct ok_code?

Else, could you consider using another tool like method CMD_EI_API=MAINTAIN_BAPI? (e.g. Filling CENTRAL_DATA-TAX_IND-TAX_IND[] from the result of a call of CMD_EI_API_EXTRACT=>GET_DATA and applying your required changes)

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

Did you execute the recording (SHDB) with "Simulate Background Mode" and "Default size" set or did you analyze the dynpro/status during a call of XD02 to find a correct ok_code?

Else, could you consider using another tool like method CMD_EI_API=MAINTAIN_BAPI? (e.g. Filling CENTRAL_DATA-TAX_IND-TAX_IND[] from the result of a call of CMD_EI_API_EXTRACT=>GET_DATA and applying your required changes)

0 Kudos


SHDB values are same and passed all

"Simulate Background Mode" and "Default size".

Can you share some example for

CMD_EI_API . Tried its not working

Thank you in advance

.

Tnx . Tried with

CMD_EI_API_EXTRACT=>GET_DATA ..Working

Sharing Code for others:

REPORT ztest_sh_cust.
DATA is_master_data TYPE cmds_ei_main.
DATA: es_master_data TYPE cmds_ei_main.
DATA: es_error TYPE cvis_message.
DATA: wa_customers type cmds_ei_extern.
DATA: lt_sales TYPE cmds_ei_sales_t.
DATA: wa_sales LIKE LINE OF lt_sales.
data: gp_vkorg TYPE vkorg.
data: gp_vtweg TYPE vtweg.
data: gp_spart TYPE spart.
data :lw_master_data_correct TYPE cmds_ei_main,
lw_message_correct TYPE cvis_message,
lw_master_data_defective TYPE cmds_ei_main,
lw_message_defective TYPE cvis_message
.
data : cs_customer type REF TO CMD_EI_API.
data : is_tax TYPE CMDS_EI_CMD_TAX_IND.
FIELD-SYMBOLS:
<lf_cst> TYPE cmds_ei_extern,
<lf_gen> TYPE cmds_ei_central_data.

gp_vkorg = '1100'.
gp_vtweg = '10'.
gp_spart = '10'.
* Check obligatory fields for KNVV
CHECK gp_vkorg IS NOT INITIAL AND gp_vtweg IS NOT INITIAL
AND gp_spart IS NOT INITIAL.
* Control parameters
wa_customers-header-object_instance-kunnr = '0000000081'. "customer number
wa_customers-header-object_task = 'U'. "update customer
APPEND wa_customers TO is_master_data-customers.
* Read customer
cmd_ei_api_extract=>get_data( EXPORTING is_master_data = is_master_data
IMPORTING es_master_data = es_master_data ).

data : wa_taxind type CMDS_EI_TAX_IND.
READ TABLE es_master_data-customers ASSIGNING <lf_cst> INDEX 1.
CHECK sy-subrc EQ 0.
loop at <lf_cst>-CENTRAL_DATA-TAX_IND-tax_ind into wa_taxind.
if wa_taxind-DATA_KEY-TATYP eq 'JIN1'.
wa_taxind-DATA-TAXKD = '1'.
MODIFY <lf_cst>-CENTRAL_DATA-TAX_IND-tax_ind from wa_taxind TRANSPORTING DATA_KEY DATA.
endif.
endloop.
*
<lf_cst>-header-object_task = 'U'. "update customer

modify es_master_data-customers from <lf_cst> INDEX 1.

cmd_ei_api=>maintain( EXPORTING is_master_data = es_master_data
IMPORTING es_error = es_error ).

IF es_error-is_error IS INITIAL.
** No errors? Commit work
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.

Thank you

Sandra_Rossi
Active Contributor

The keys "page down" and "page up" simply don't work in batch input, as said in this SCN thread : As said in the note 11788 - Batch input, variable step loop or table control : "Please note that scrolling in a table control with the vertical scroll bar cannot be used in batch input. In the batch input you can only scroll in a table control if the application specifically provides and processes OK codes for this." ...



Yes Screens for Credit Note Debit Note and QM also have OK Codes and BDC with P+ is working fine.