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: 

Selecting radio button in bdc for IT0021

Former Member
0 Kudos

Hi ,

I generated a recording for IT0021.The recording is unable to select the radio button for fields gender in both foreground and background mode and when I tried to upload the data the data ,it gets uploaded when I left the values for the gender field but when I enter the values of fields for GESC1 as X and GESC2 as blank the value X gets uploaded to position next to gender that is in the FGBDT field so how to solve it.

HERE is the recording I did:

perform bdc_dynpro      using 'SAPMP50A' '1000'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'RP50G-PERNR'

                               ITAB-PERNR."'10'.

perform bdc_field       using 'RP50G-TIMR6'

                               'X'.

perform bdc_field       using 'BDC_CURSOR'

                               'RP50G-CHOIC'.

perform bdc_field       using 'RP50G-CHOIC'

                               '21'.

perform bdc_dynpro      using 'SAPMP50A' '1000'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'RP50G-PERNR'

                               ITAB-PERNR."'10'.

perform bdc_field       using 'RP50G-TIMR6'

                               'X'.

perform bdc_field       using 'BDC_CURSOR'

                               'RP50G-SUBTY'.

perform bdc_field       using 'RP50G-CHOIC'

                               'Family Member/Dependents'.

perform bdc_field       using 'RP50G-SUBTY'

                               ITAB-SUBTY."'1'.

perform bdc_dynpro      using 'SAPMP50A' '1000'.

perform bdc_field       using 'BDC_CURSOR'

                               'RP50G-PERNR'.

perform bdc_field       using 'BDC_OKCODE'

                               '=INS'.

perform bdc_field       using 'RP50G-PERNR'

                               ITAB-PERNR."'10'.

perform bdc_field       using 'RP50G-TIMR6'

                               'X'.

perform bdc_field       using 'RP50G-CHOIC'

                               'Family Member/Dependents'.

perform bdc_field       using 'RP50G-SUBTY'

                               ITAB-SUBTY."'1'.

perform bdc_dynpro      using 'MP002100' '2000'.

perform bdc_field       using 'BDC_CURSOR'

                               'P0021-FGBOT'.

perform bdc_field       using 'BDC_OKCODE'

                               'UPD'.

perform bdc_field       using 'P0021-BEGDA'

                               ITAB-BEGDA."'1.04.2015'.

perform bdc_field       using 'P0021-ENDDA'

                               ITAB-ENDDA."'31.12.9999'.

perform bdc_field       using 'P0021-FANAM'

                               ITAB-FANAM."'mira'.

perform bdc_field       using 'P0021-FAVOR'

                               ITAB-FAVOR.

  perform bdc_field   using 'Q0021-GESC2'

                                ''.

     perform bdc_field   using 'Q0021-GESC1'

                                'X'.

perform bdc_field       using 'P0021-FGBDT'

                               ITAB-FGBDT."'27.09.1990'.

perform bdc_field       using 'P0021-FGBOT'

                               ITAB-FGBOT."'delhi'.

perform bdc_field       using 'P0021-FGBLD'

                               ITAB-FGBLD."'IN'.

perform bdc_field       using 'P0021-FANAT'

                               ITAB-FANAT."'IN'.



Thanks .


Regards

Nav

1 ACCEPTED SOLUTION

ipravir
Active Contributor
0 Kudos

Hi Navratan,

Why are you not using HR_INFOTYPE_OPERATIONS Function module.

Even the same FM is calling when you execute PA30 t-code.

HR_INFOTYPE_OPERATION to update SAP hr infotypes - function module - ABAP

http://www.wikiguga.com/topic/0b7d943b4f17b738ef015bd5e0d85b91

Regards,

Praveer.

27 REPLIES 27

former_member756887
Participant
0 Kudos

For Which Transaction Code ????

0 Kudos

Hi,

I did it for PA30 tcode.

Regards

Nav

Former Member
0 Kudos

Hi,

I guess for gender, you should pass value like 1 for Male and 2 for Female.

Best Regards,

Ketul

0 Kudos

Hi Ketul,

I have already done this but the problem is that radio button is not selected and the Numbers 1 and 2 moves to the next field.

Regards

Nav

prakashjasti
Contributor

Hi Navratan,

Please check the sequence of fields and change the recording as required.

Regards,

Prakash.

Prakash J

0 Kudos

Hi Prakash,

I have maintained the sequence of the fields according to the reording generated and even did the recording again but still the same problem.

Regards

Nav

ipravir
Active Contributor
0 Kudos

Hi Navratan,

Why are you not using HR_INFOTYPE_OPERATIONS Function module.

Even the same FM is calling when you execute PA30 t-code.

HR_INFOTYPE_OPERATION to update SAP hr infotypes - function module - ABAP

http://www.wikiguga.com/topic/0b7d943b4f17b738ef015bd5e0d85b91

Regards,

Praveer.

Former Member
0 Kudos

Hi Praveer,

Thanks for your suggestion . I already know about it but I don't want to use this function module.I want to solve it for the codes I have written which have worked well for all other infotypes except this so I just wanted to solve without adding this fm.Any suggestions?

Regards

Nav

ipravir
Active Contributor
0 Kudos

Hi Navratan,

How many fields are in upload file, 13?

Have you check in debug, how data is passing to BDCDATA table.

In above code, you have pass 'X' value, which is not from table.

perform bdc_field   using 'Q0021-GESC1'

                                'X'.

Regards,

Praveer.

Former Member
0 Kudos

Hi Praveer,

Sorry while pasting the codes I forgot to make the changes I made.I have used it this way.

perform bdc_field   using 'Q0021-GESC2'

                                               ITAB-GESC2.                       " "

perform bdc_field   using 'Q0021-GESC1'

                                                   ITAB-GESC1.                          "X'.

ipravir
Active Contributor
0 Kudos

Hi Navratan,

As it's a radio so you have to pass a single value at a time.

if ITAB-GESC2 eq ABAP_TRUE.

    

perform bdc_field   using 'Q0021-GESC2'

                                               'X'


if Q0021-GESC1 eq ABAP_TRUE.

    

perform bdc_field   using 'Q0021-GESC1'

                                               'X'


endif.

Regards,

Praveer,

Former Member
0 Kudos

Hi Praveer,

I did a debug on this but I saw the same problem in the debug mode.Here gender radio button is already selected to the value which was done during the recording and so the values for gender field moves to next field.12 fields are there in upload file.

Regards

Nav

ipravir
Active Contributor
0 Kudos

Hi Navratan,

Radio button works in groups, so you have to select any one of field information at a time, other fields value will get updated with BLANK automatically.

In your case, you have to pass only checked field information either Male / Female. based on your excel file information.

Follow the logic what i have given earlier .

Regards,

Praveer.

Former Member
0 Kudos

Hi Praveer,

I have tried this

if itab-gesc1 ne space.

perform bdc_field   using 'Q0021-GESC2'

                                ''.

perform bdc_field   using 'Q0021-GESC1'

                                'X'.

elseif itab-gesc2 ne space.

perform bdc_field   using 'Q0021-GESC2'

                                'X'.

perform bdc_field   using 'Q0021-GESC1'

                                ''.

endif.





which I hope is equivalent to what you said and even this not works.


Regards

Nav

ipravir
Active Contributor
0 Kudos

Hi Navratan,

You have to pass only fill information in BDC.

follow below logic.

if itab-gesc1 ne space.

perform bdc_field   using 'Q0021-GESC1'

                                'X'.

elseif itab-gesc2 ne space.

perform bdc_field   using 'Q0021-GESC2'

                                'X'.

endif.


other field will get update with SPACE automatically.


Try to execute the program in foreground you will get clear picture of process.


Regards,

Praveer.


0 Kudos

You must use field FASEX and pass '1' or '2'. We cannot use the Q0021 fields, therefore delete these 2 lines from your recording and use P0021-FASEX instead.

Former Member
0 Kudos

Hi Praveer,

This is the data I have maintained to be uploaded

pernr subtybegdaenddafavorfname gesc1gesc2fgbdtfgbotfgbldfanat
2120704198431129999KUMARAJAYX16061999delhiInIN

When running in foreground mode I am getting the data uploaded in above format.

Regards

Nav

Former Member
0 Kudos

HI Glen,

Thanks for the reply.I did as you suggested using the codes this way.

IF ITAB-FASEX NE SPACE.

perform bdc_field       using 'P0021-FASEX'

                               ITAB-FASEX.

ENDIF.


But still getting the data uploade in the format as below




Regards

Nav

0 Kudos

the code is incorrect.

What value is in ITAB-FASEX?

Please debug and enter ITAB-FASEX and Q0021-GESC1/2, and post the screenshot here.

Your code should be somthing like:

if q0021-gesc1 = 'X'.

perform bdc_field   using 'P0021-FASEX'  '1'.

elsesif q0021-gesc2 = 'X'.

perform bdc_field       using 'P0021-FASEX'  '2'.

ipravir
Active Contributor
0 Kudos

Hi Navratan,

Can you share program code? (includes data declaration).

Something is not right? may be data is not passing into internal table is right manner.

Regards,

Praveer.

Former Member
0 Kudos

Hi Glen ,

I tried this code:

if ITAB-GESC1 = 'X'.

perform bdc_field   using 'P0021-FASEX'

                                      '1'.

elseif ITAB-GESC2 = 'X'.

perform bdc_field       using 'P0021-FASEX'

                                          '2'.

endif.


Here I am maintaining two fileds for the data I am uploading that is GESC1 and GESC2 .For male GESC1 = X and GESC2 = BLANK and vice vers


But still getting the same output as shown above.

Regards

Nav

Former Member
0 Kudos

Hi Praveer,

This is the codes for my data declaration:

types: begin of ty_mat,

        PERNR TYPE RP50G-PERNR,

        SUBTY TYPE RP50G-SUBTY,

        OBJPS TYPE P0021-OBJPS,

        BEGDA TYPE P0021-BEGDA,

        ENDDA TYPE P0021-ENDDA,

        FANAM TYPE P0021-FANAM,

        FAVOR TYPE P0021-FAVOR,

        FGBDT TYPE P0021-FGBDT,

        FGBOT TYPE P0021-FGBOT,

        FGBLD TYPE P0021-FGBLD,

        FANAT TYPE P0021-FANAT,

        GESC1 TYPE Q0021-GESC1,

        GESC2 TYPE Q0021-GESC2,

        FASEX TYPE P0021-FASEX,

        end of ty_mat.

data: itab type table of ty_mat with header line.



The recordings are same as posted earlier with some changes that I have already posted as suggested by Glen.


But the same problem

Regards

Nav

ipravir
Active Contributor
0 Kudos

Hi Navaratan,

The data declaration and given excel file format are not matching.

Make the field name and data arrange in excel in same manner and then try to debug the program and check how data is arranging in BDCDATA table with respect to FIELD and values.

Regards,

Praveer.

Former Member
0 Kudos

Hi Praveer,

Thanks for reminding me about this after making a lots of changes to the codes few fields got misplaced and after making this changes and what Glen said I got the required result.

Regards

Nav

Former Member
0 Kudos

Hi,

   First while rcording,

first click the first radio button  press enter, then fill all remaining values, then click second radio butto gender, without press enter just save the infotype...

copy the recording and go for BDC coding...

The best suggested way is to use BAPI function hr_infotype_operation , for the same...

It will works,

Thanks,

Vijay SR

0 Kudos

Hi Vijay,

Thanks for the reply.I have already done as you have said and still not working and the second thing I wanted to solve it without using the fm you said,

Regards

Nav

Former Member
0 Kudos

Hello everyone,

Thanks to everyone for your replies.The problem is solved.

Regards

Nav