2013 May 14 10:45 AM
Hello Experts,
I'm using BDC code to delete the Fax number of Customer (table KNA1 / ADRC) - Field TELFX.
But it is not deleting the Fax number.
The same code is working for 'Change / Add' operations but not 'Delete'.
Here's my code:
PERFORM bdc_dynpro USING 'SAPMF02D' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02D-D0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02D-KUNNR'
p_kunnr.
PERFORM bdc_field USING 'RF02D-D0110'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02D' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KNA1-TELFX'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'KNA1-TELFX'
' '.
test-dismode = 'N'.
test-updmode = 'S'.
CALL TRANSACTION 'XD02' USING g_t_bdcdata OPTIONS FROM test
MESSAGES INTO tab_mess AND SKIP FIRST SCREEN .
Please do let me know why DELETE is not working.
Please help.
Thanks & Regards,
Sowmya
2013 May 17 4:47 AM
Hello Experts,
It's not working now
I don't understand why
Here's my BDC Code:
PERFORM bdc_dynpro USING 'SAPMF02D' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02D-D0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02D-KUNNR'
p_g_wa_custfax_kunnr.
PERFORM bdc_field USING 'RF02D-D0110'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02D' '0110'.
PERFORM bdc_field USING 'SZA1_D0100-FAX_NUMBER' ' '.
* PERFORM bdc_field USING 'SZA1_D0100-FAX_EXTENS' ' '.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
test-dismode = 'N'.
test-updmode = 'S'.
CALL TRANSACTION 'XD02' USING g_t_bdcdata OPTIONS FROM test
MESSAGES INTO tab_mess.
Even with
PERFORM bdc_field USING 'SZA1_D0100-FAX_EXTENS' ' '.
it is not working now.
Please help.
-Sowmya
Hello Experts,
I'm using BDC code to delete the Fax number of Customer (table KNA1 / ADRC) - Field TELFX.
But it is not deleting the Fax number.
The same code is working for 'Change / Add' operations but not 'Delete'.
Here's my code:
PERFORM bdc_dynpro USING 'SAPMF02D' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02D-D0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02D-KUNNR'
p_kunnr.
PERFORM bdc_field USING 'RF02D-D0110'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02D' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KNA1-TELFX'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'KNA1-TELFX'
' '.
test-dismode = 'N'.
test-updmode = 'S'.
CALL TRANSACTION 'XD02' USING g_t_bdcdata OPTIONS FROM test
MESSAGES INTO tab_mess AND SKIP FIRST SCREEN .
Please do let me know why DELETE is not working.
Please help.
Thanks & Regards,
Sowmya
2013 May 14 12:32 PM
Hi,
Use this
PERFORM bdc_field USING 'KNA1-TELFX'
' '.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
Instead of
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'KNA1-TELFX'
' '.
2013 May 15 9:45 AM
Hi Rahul,
I tried as per your suggestion.
It is still not working.
Thanks & Regards,
Sowmya
2013 May 15 10:05 AM
Hi,
Try to run this report in mode 'A' (instead of 'N') to see what's going on.
My first shot would be that transaction is calling commit work twice (when you run bdc after first commit transaction ends). If that's the case then use addition OPTIONS FROM and set in field RACOMMIT value 'X'.
Best Regards
Marcin Cholewczuk
2013 May 15 10:20 AM
Hi Marcin,
Thanks for the reply.
I checked by changing the mode to 'A'. It just saves by setting Fax number = ' '.
But when I go and see using XD03, it has not deleted the Fax number.
I also tried RACOMMIT = 'X' as per your suggestion. But still it's not working.
Thanks & Regards,
Sowmya
2013 May 15 10:27 AM
The best way is to do a small recording for the same via SHD and then compare the existing code with the new program and just replace the code sequence of deletion of tel number with new code.
2013 May 15 10:34 AM
2013 May 15 10:40 AM
Dear Sowmya,
What happen if you run the recording in test mode ? Does this delete this fax Number or not.
Regards,
Rahul
2013 May 15 11:02 AM
2013 May 15 11:28 AM
This means the error is in your code. Try to debug the same and run the program in foreground i hope this could be the error where "Screen field KNA1-TELFX does not exist" .This is my assumption .
Better to debug the same.
2013 May 15 10:40 AM
try giving default size in your options as blank.....
test-defsize = space.
2013 May 15 10:59 AM
I tried giving test-defsize = space.
It's not deleting the fax number.
-Sowmya
2013 May 15 11:15 AM
2013 May 15 11:22 AM
I removed the line AND SKIP FIRST SCREEN. Still not working.
2013 May 15 11:26 AM
PERFORM bdc_dynpro USING 'SAPMF02D' '0401'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KNA1-TELFX'.
PERFORM bdc_field USING 'KNA1-TELFX'
' '.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
please try above code i think it will solve your query
2013 May 15 11:35 AM
try giving a value like 'test' in KNA1-TELFX....
see if it updates a value... looks like it is not updating a blank value....
2013 May 15 11:42 AM
2013 May 15 11:43 AM
Hi Maverick,
If I give any test value like '12345', then it is updating. If I give ' ' (space), then it doesn't.
So, BDC doesn't work here?
Thanks & Regards,
Sowmya
2013 May 15 11:59 AM
try to use
PERFORM bdc_field USING 'KNA1-TELFX'
space.
or
PERFORM bdc_field USING 'KNA1-TELFX'
' '.
2013 May 15 12:11 PM
2013 May 15 12:12 PM
afraid so... if you reiterate your recording steps , and save you will definitely see that the blank value was not saved in KNA1... so not a problem in BDC , the values are not changing in recording too....
may be you need to find a BAPI(something like BAPI_CUSTOMER_CHANGEFROMDATA or CHANGEFROMDATA1 (not sure if you can update the fax through this)) for modifying the address details of customer , there you can set fax as blank.
OR
if your analyst is fine then you can put a 0 in the field...
Also can you change your recording inputs , like ticking the default size , and no batch input , and then do the recording and try to delete the fax number by that way ,(you need to change your program for that) it will definitely work...
Message was edited by: Maverick Manoj
2013 May 15 12:14 PM
Hi Sowmya!
Im not sure, but does field 'TELFX' have any transitive dependency on another field?
Regards,
KS
2013 May 15 12:55 PM
PERFORM bdc_dynpro USING 'SAPMF02D' '0401'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SZA1_D0100-FAX_NUMBER'.
PERFORM bdc_field USING 'SZA1_D0100-FAX_NUMBER' ' '.
PERFORM bdc_field USING 'SZA1_D0100-FAX_EXTENS' ' '.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
2013 May 15 1:00 PM
Hi,
Try recording with ECATT and see if it works.
Regards,
Swarna
2013 May 16 7:11 AM
2013 May 16 7:35 AM
2013 May 15 12:26 PM
2013 May 17 6:55 AM
2013 May 15 12:26 PM
Kindly share the code of your original recording and current program.
Regards,
Rahul
2013 May 15 2:09 PM
You need to change the recording.
In first screen of XD02, check checkbox 'Use central address management'.
Your code would then be something like this.
PERFORM bdc_dynpro USING 'SAPMF02D' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02D-KUNNR'
p_kunnr.
PERFORM bdc_field USING 'RF02D-D0110'
'X'.
PERFORM bdc_field USING 'USE_ZAV'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02D' '0111'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'SZA1_D0100-FAX_NUMBER'
''.
PERFORM bdc_transaction USING 'XD02'.
2013 May 17 4:47 AM
Hello Experts,
It's not working now
I don't understand why
Here's my BDC Code:
PERFORM bdc_dynpro USING 'SAPMF02D' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02D-D0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02D-KUNNR'
p_g_wa_custfax_kunnr.
PERFORM bdc_field USING 'RF02D-D0110'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02D' '0110'.
PERFORM bdc_field USING 'SZA1_D0100-FAX_NUMBER' ' '.
* PERFORM bdc_field USING 'SZA1_D0100-FAX_EXTENS' ' '.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
test-dismode = 'N'.
test-updmode = 'S'.
CALL TRANSACTION 'XD02' USING g_t_bdcdata OPTIONS FROM test
MESSAGES INTO tab_mess.
Even with
PERFORM bdc_field USING 'SZA1_D0100-FAX_EXTENS' ' '.
it is not working now.
Please help.
-Sowmya
2013 May 17 4:53 AM
I thing you are using wrong screen "SAPMF02D" '0111' instead of '0110'. Check !!!
2013 May 17 5:02 AM
2013 May 17 5:10 AM
2013 May 17 6:02 AM
2013 May 17 7:53 AM
In order to understand why it is not working, create fresh BDC recording.
In first screen of XD02 where customer number is entered, check checkbox 'Use central address management'.
2013 May 17 9:41 AM
Thanks so much Manish..
At last it worked now.
Here's my code:
PERFORM bdc_dynpro USING 'SAPMF02D' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'USE_ZAV'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RF02D-KUNNR'
p_g_wa_custfax_kunnr.
PERFORM bdc_field USING 'RF02D-D0110'
'X'.
PERFORM bdc_field USING 'USE_ZAV'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02D' '0111'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SZA1_D0100-FAX_NUMBER'.
PERFORM bdc_field USING 'SZA1_D0100-FAX_NUMBER'
''.
PERFORM bdc_field USING 'SZA1_D0100-FAX_EXTENS'
''.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |