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: 

Populate BDCDATA table rutime for XD02

Former Member
0 Kudos

Hi,

Can anybody help me how to populate BDCDATA table thru code based on values provided by user?

My exact rqeuirement is, for transaction XD02 (Change Customer), user will provide only those values which have been changed by him. So I have to perform a check if at all values is there then only that field should become a part of BDCDATA table. I can determine field name and field value from user provided data, but how to determine Program Name and Screen Number?

Please advise.

-Tejal

1 ACCEPTED SOLUTION

Bema
Active Participant
0 Kudos

Hi Tejal,

You will get the screen no after recording itself.

Do recording in SHDB.Save it.Go back.Click on 'Process'.

Give some program name.Choose 'Transfer from recording'.

Then you will get the code with screen no and all.

Then modify the code as I specified.

Create an internaltable to get the values from the file .

Use WS_FILENAME_GET function to get the filename.

Then WS_UPLOAD fun to upload the file content to internal table.

Then loop the code,

perform open_group.

perform bdc_field..

here give the if condition for all the perfom bc_field.

perform bdc_transaction using 'XD02'

endloop.

perform close_group.

9 REPLIES 9

Former Member
0 Kudos

hi, I think you can record a BDC process of XD02, it will store all the information you need, include program name and screen number.

combine with the field name of use provide and BDC record, then you can make clear the program name and screen number.

hope my answer is helpful

Former Member
0 Kudos

Hi Tejal

you can have a look at following link for more information, its a link about Data Transfer, under this topic, BDC recording using SHDB is also covered :

http://help.sap.com/saphelp_47x200/helpdata/en/67/42fcccf61011d1bcf9080009b4534c/frameset.htm

I hope the above topic will cater you all your requirements but still:

You can determine a program name and screen number in the pop up window when we use: SYSTEM(in the top menu) -> STATUS

Regards

Ashish Jain

Bema
Active Participant
0 Kudos

Hi ,

Do a recording for XD02 including all the fields.

Then create a flat file (Excel or txt)with all the field headings.(Eg. Custno,Accountgroup, salesorg,distchannel....)

Suppose user asked to modify the name of this customer.

In the flat file, under the name field, give the new name and enter the custno also.

Then modify ur coding like

if itab-name1 ne ''.

perform bdc_field using 'KNA1-NAME1'

itab-name1.

endif.

Modify ur code for all the fileds like this.

Former Member
0 Kudos

Hi Beena,

Even I was think on the similar lines.

if itab-name1 ne ''.

perform bdc_field using 'KNA1-NAME1'

itab-name1.

endif.

At this stage I have field name and value but what about screen number and program name? They are available with F1 help, but how to use while coding? I want to avoid hard-coding.

Thanks,

-Tejal

Former Member
0 Kudos

Hi Tejal,

I think, you can dynamically fetch name of program and screen for that field using FM DYNP_VALUES_READ.

But i don't think so you get right result.

I suggest, you do full recording for XD02 and fill BDCDATA. Then again before call transaction, loop the BDCDATA and delete those fields which you don't want to update. Modify BDCDATA.

I feel, it will work.

Reg,

Arpit

Former Member
0 Kudos

Why don't you use B.I. standard (RFBIDE00) or BAPI?

Former Member
0 Kudos

Hi Arpit,

Even full recording won't serve the purpose as some of the fields are missing when I do recording i.e. SHDB recording does not capture all fields actually present for XD02 transaction. Also FM suggested by you does not give program name/screen number from field name.

-Tejal

Former Member
0 Kudos

Perahpas you can see the standard customer BI RFBIDE00 to know field and screen.

But for me it should be better to use the RFBIDE00, so you haven't the problem to know in which screen a field is.

You could use RSBDCSUB too, so in the same your program you can create and run batchinput session

Bema
Active Participant
0 Kudos

Hi Tejal,

You will get the screen no after recording itself.

Do recording in SHDB.Save it.Go back.Click on 'Process'.

Give some program name.Choose 'Transfer from recording'.

Then you will get the code with screen no and all.

Then modify the code as I specified.

Create an internaltable to get the values from the file .

Use WS_FILENAME_GET function to get the filename.

Then WS_UPLOAD fun to upload the file content to internal table.

Then loop the code,

perform open_group.

perform bdc_field..

here give the if condition for all the perfom bc_field.

perform bdc_transaction using 'XD02'

endloop.

perform close_group.