12-27-2005 5:49 AM
hi i have the following bdc..
REPORT zbapi NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
START-OF-SELECTION.
PERFORM open_group.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-SUBTY'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'6'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'2'.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'Addresses (IT0006)'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'2'.
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-STATE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_transaction USING 'PA30'.
PERFORM close_group.
i want to change the STATE nd LAND1, but by using the above BDC it doesn't change the value i pass, but it works with normal run can any one see wat's wrong witd the above BDC.
abhishek suppal
12-27-2005 6:05 AM
Hi,
Instead of BDC_OKCODE as '/00' pass '=UPD'.
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-STATE'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
****
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-BEGDA'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
Best regards,
Prashant
12-27-2005 6:06 AM
Hi Abhishek,
1. I tried your code.
2. For my side,
i modified the PERNR and subtype.
3. It works well now.
4. Try this code (just copy paste)
I have commented out some lines,which were
not required,
Moreover, the SCREEN NUMBER in our case was
2000.
U can use yours.
5.
REPORT zbapi NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
START-OF-SELECTION.
PERFORM open_group.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RP50G-PERNR'
'776'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-SUBTY'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'6'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'Addresses (IT0006)'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'1'.
*
PERFORM bdc_dynpro USING 'MP000600' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-STATE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
*
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_transaction USING 'PA30'.
PERFORM close_group.
I hope it helps.
regards,
amit m.
12-27-2005 6:15 AM
hi amit
REPORT zbapi NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
START-OF-SELECTION.
PERFORM open_group.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-SUBTY'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'6'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'2'.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'Addresses (IT0006)'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'2'.
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'P0006-STATE'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_transaction USING 'PA30'.
PERFORM close_group.
i tried this but it takes the blank field in STATE i m not able to understand why its doing so.....
It takes the blank value in STATE Field, if i pass SA....
abhishek suppal
Message was edited by: Abhishek Suppal
12-27-2005 6:26 AM
Hi again,
1. u are right.
2. i tried your code in 'A' Mode (display all screens)
(It was giving error / it was getting stuck
in between becasue of wrong sequence
of populating the fields and okcode)
Moreover it was not saving the transaction
However i rectified that.
3. I had to change the screen number to 2000(in my case)
so that the effect comes.
4. Please test your screen number also.
Is it 2000 or something else.
5. Did u try my code. (It works fantastic)
( it is your code only with minor modification)
Just check it once again
(if u need, modify it a little for pernr, etc)
regards,
amit m.
Message was edited by: Amit Mittal
Message was edited by: Amit Mittal
12-27-2005 6:37 AM
Amit
my screen no. is 2004 n i have tried ur code also but no results n also i have changed teh sequense of LAND1 and STATE also but nothing happened it justs picks the blank value.... any idea...
abhishek suppal
12-27-2005 6:47 AM
AMit
i have commented the line
PERFORM bdc_field USING 'P0006-LAND1'
'IN'.
Now it works fine the state is changed, but can u tell me is this the only solution for this coz mayy be we have to change the country also.
Prashant i have changed the State to no. also but that also doesn't work
12-27-2005 6:08 AM
Hi,
One more point to mention is :-
You need to pass corresponding state numbers instead of state names for the STATE field.
Best regard,
Prashant
12-27-2005 6:39 AM
Hi Abhishek,
Pass corresponding number for State Names.
This is the only error in your program.
Best regards,
Prashant
12-27-2005 6:43 AM
Hi Abhishek,
I have tried the same and i hope that state and land1 can be updated.... Only one thing u have to do is check whether the corrsponding country key has(Land1-AU has State -SA or not ) just check whether For Land1 there is corresponding State availabe in table <b>T005S</b>....
u can see the following code which has been working..
perform open_group.
perform bdc_dynpro using 'SAPMP50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=ZEIT'.
perform bdc_field using 'RP50G-PERNR'
'3'.
perform bdc_field using 'BDC_CURSOR'
'T582S-ITEXT(04)'.
perform bdc_field using 'RP50G-SELEC(04)'
'X'.
perform bdc_field using 'RP50G-TIMR6'
'X'.
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'
'3'.
perform bdc_field using 'RP50G-TIMR6'
'X'.
perform bdc_field using 'RP50G-CHOIC'
'Addresses'.
perform bdc_dynpro using 'MP000600' '2008'.
perform bdc_field using 'BDC_CURSOR'
'P0006-STATE'.
perform bdc_field using 'BDC_OKCODE'
'=UPD'.
perform bdc_field using 'P0006-BEGDA'
'25.08.2003'.
perform bdc_field using 'P0006-ENDDA'
'31.12.9999'.
perform bdc_field using 'P0006-ANSSA'
'1'.
perform bdc_field using 'P0006-STRAS'
'1234'.
perform bdc_field using 'P0006-PSTLZ'
'124567'.
perform bdc_field using 'P0006-STATE'
'SG'.
perform bdc_field using 'P0006-LAND1'
'GB'.
perform bdc_transaction using 'PA30'.
perform close_group.
Regards,
Sridhar Reddy k
Message was edited by: sridhar reddy kondam
12-27-2005 7:15 AM
Hi Abhishek,
Just check whether the Region/state avaialable for the coreeponding Country... in table <b>T005S</b> ...
u can see the following code which has been working..
perform open_group.
perform bdc_dynpro using 'SAPMP50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=ZEIT'.
perform bdc_field using 'RP50G-PERNR'
'3'.
perform bdc_field using 'BDC_CURSOR'
'T582S-ITEXT(04)'.
perform bdc_field using 'RP50G-SELEC(04)'
'X'.
perform bdc_field using 'RP50G-TIMR6'
'X'.
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'
'3'.
perform bdc_field using 'RP50G-TIMR6'
'X'.
perform bdc_field using 'RP50G-CHOIC'
'Addresses'.
perform bdc_dynpro using 'MP000600' '2008'.
perform bdc_field using 'BDC_CURSOR'
'P0006-STATE'.
perform bdc_field using 'BDC_OKCODE'
'=UPD'.
perform bdc_field using 'P0006-BEGDA'
'25.08.2003'.
perform bdc_field using 'P0006-ENDDA'
'31.12.9999'.
perform bdc_field using 'P0006-ANSSA'
'1'.
perform bdc_field using 'P0006-STRAS'
'1234'.
perform bdc_field using 'P0006-PSTLZ'
'124567'.
perform bdc_field using 'P0006-STATE'
'SG'.
perform bdc_field using 'P0006-LAND1'
'GB'.
perform bdc_transaction using 'PA30'.
perform close_group.
Regards,
Sridhar Reddy k
12-27-2005 9:02 AM
i have checked in the table T005S the value is there, but the code given by u is not working the code only works when i comment the LAND1 line, i don't know why it is behaving like this but its doing this....
12-27-2005 9:08 AM
Hi again,
1. Apart from bdc,
are u able to ENTER the values
manually thru transaction PA30.
including LAND1 ?
2. After running your / our code,
u say, its not happening
3. Actually what error / what is happending?
4. Is the record not saved ?
some error message comes ?
The program gets held up there
and the screen of infotpe 0006 is
seen ?
regards,
amit m.
12-27-2005 9:23 AM
Hi,
After changing the values..hope u are not capturing the OK_CODE s for SAVE and BACK in PA30.
Add that piece of code as performs.
12-27-2005 6:46 AM
Hi again,
1. As u say ur screen number is 2004,
2. try this code again (just copy paste)
It has your screen number,
your personnel number 1, and subtype 2
3. In Region TAS should come (Tasmania)
4. Check it in A Mode.
REPORT zbapi NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
START-OF-SELECTION.
PERFORM open_group.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-SUBTY'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'6'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'2'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
PERFORM bdc_field USING 'RP50G-PERNR'
'1'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'Addresses (IT0006)'.
PERFORM bdc_field USING 'RP50G-SUBTY'
'1'.
*
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-STATE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'P0006-STATE'
'SA'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
*
PERFORM bdc_dynpro USING 'MP000600' '2004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0006-STATE'
'TAS'.
PERFORM bdc_field USING 'P0006-LAND1'
'AU'.
PERFORM bdc_transaction USING 'PA30'.
PERFORM close_group.
regards,
amit m.
12-27-2005 7:07 AM
i have tested with ur code AMit but it doesn't work it only works when i comment the LAND1 line i.e i don't change the country, also we have setting like the STATE field is compulsory in the screen.......