08-24-2015 6:25 AM
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
08-24-2015 11:02 AM
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.
08-24-2015 10:47 AM
08-24-2015 10:50 AM
08-24-2015 10:47 AM
Hi,
I guess for gender, you should pass value like 1 for Male and 2 for Female.
Best Regards,
Ketul
08-24-2015 10:54 AM
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
08-24-2015 11:00 AM
Hi Navratan,
Please check the sequence of fields and change the recording as required.
Regards,
Prakash.
08-24-2015 11:05 AM
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
08-24-2015 11:02 AM
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.
08-24-2015 11:12 AM
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
08-24-2015 11:27 AM
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.
08-24-2015 11:34 AM
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'.
08-24-2015 11:49 AM
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,
08-24-2015 11:56 AM
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
08-24-2015 12:00 PM
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.
08-24-2015 12:01 PM
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
08-24-2015 12:06 PM
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.
08-24-2015 12:15 PM
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.
08-24-2015 12:22 PM
Hi Praveer,
This is the data I have maintained to be uploaded
pernr | subty | begda | endda | favor | fname | gesc1 | gesc2 | fgbdt | fgbot | fgbld | fanat |
21 | 2 | 07041984 | 31129999 | KUMAR | AJAY | X | 16061999 | delhi | In | IN | |
When running in foreground mode I am getting the data uploaded in above format.
Regards
Nav
08-24-2015 12:34 PM
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
08-24-2015 12:46 PM
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'.
08-24-2015 1:08 PM
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.
08-25-2015 4:44 AM
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
08-25-2015 4:57 AM
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
08-25-2015 6:28 AM
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.
08-25-2015 6:51 AM
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
08-24-2015 12:09 PM
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
08-24-2015 12:36 PM
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
08-25-2015 6:54 AM
Hello everyone,
Thanks to everyone for your replies.The problem is solved.
Regards
Nav