04-11-2006 3:05 PM
Hi'
Im a rooki so bare with me. My task is, that I recive a lot of data for creating a Vendor in transaction FK01. The first page can be filled with parameters and a Call Transaction and skip first screen. That's fine. Now i want the next screens to be populated with values, so the user just has to browse through the pages and in the end confim by saving the data.
I have tried something with the structure BDCData, but I cannot use Call Transaction Using BDCDATA at the same time as I use Skip First Screen.
Any help will be greatly appreciated.
Kind regards
Mikkel
Message was edited by: Mikkel Iversen
04-11-2006 5:59 PM
You cannot have it both ways. Users have to go through the initial screen and they want to see the other screens.
04-11-2006 3:28 PM
Hi,
Do NOT use SKIP FIRST SCREEN.
Populate the data for the first screen also in the BDCDATA and execute your program.
Regards,
Ravi
04-11-2006 5:59 PM
You cannot have it both ways. Users have to go through the initial screen and they want to see the other screens.
04-12-2006 8:04 AM
Well,
I have now tried to populate the first and second screen using the structure BDCData. The first is working fine, but when executed it says on the first screen: Field LFA1-SPRAS. does not exist in the screen SAPMF02K 0105. When i press enter it jumps to screen number 110, but does not put data in any fields.
The code is like this. In "real life" data will come from a table, but the input method is just for test purpose:
DATA: ok_code LIKE sy-ucomm,
BDCDATA TYPE TABLE OF BDCDATA,
WA_BDCDATA TYPE BDCDATA.
*Accountgroup
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = 'X'.
WA_BDCDATA-FNAM = 'RF02K-KTOKK'.
WA_BDCDATA-FVAL = 'ZHRO'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Leverandør
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'RF02K-LIFNR'.
WA_BDCDATA-FVAL = '1115'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Firmakode
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'RF02K-BUKRS'.
WA_BDCDATA-FVAL = '1000'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Name
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '111'. "v
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'ADDR1_DATA-NAME1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Search Term
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '111'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'ADDR1_DATA-SORT1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
VendorName
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'LFA1-Name1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Sort Key
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'LFA1-SORTL'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Language Key
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'LFA1-SPRAS'.
WA_BDCDATA-FVAL = 'DA'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Call Transaction 'FK01' using BDCDATA.
ENDFUNCTION.
Hope you can help
Kind regards
Mikkel
04-12-2006 8:12 AM
As you have not specified 'X' whenever the screen no changes, it is trying to find SPRAS on 0105 which is actually available in 0110. Do make the below changes and see how it works:
*Accountgroup
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = 'X'.
WA_BDCDATA-FNAM = 'RF02K-KTOKK'.
WA_BDCDATA-FVAL = 'ZHRO'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Leverandør
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'RF02K-LIFNR'.
WA_BDCDATA-FVAL = '1115'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Firmakode
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'RF02K-BUKRS'.
WA_BDCDATA-FVAL = '1000'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Name
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '111'. "v
WA_BDCDATA-DYNBEGIN =
'X'
.WA_BDCDATA-FNAM = 'ADDR1_DATA-NAME1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Search Term
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '111'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'ADDR1_DATA-SORT1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
VendorName
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN =
'X'
.WA_BDCDATA-FNAM = 'LFA1-Name1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Sort Key
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'LFA1-SORTL'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Language Key
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN = ''.
WA_BDCDATA-FNAM = 'LFA1-SPRAS'.
WA_BDCDATA-FVAL = 'DA'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
04-12-2006 8:46 AM
Hello Mikkel,
You can code like ,
DATA: ok_code LIKE sy-ucomm,
BDCDATA TYPE TABLE OF BDCDATA,
WA_BDCDATA TYPE BDCDATA.
*Accountgroup
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0105'.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = 'RF02K-KTOKK'.
WA_BDCDATA-FVAL = 'ZHRO'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Leverandør
WA_BDCDATA-FNAM = 'RF02K-LIFNR'.
WA_BDCDATA-FVAL = '1115'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Firmakode
WA_BDCDATA-FNAM = 'RF02K-BUKRS'.
WA_BDCDATA-FVAL = '1000'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Name
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '111'. "v
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = 'ADDR1_DATA-NAME1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*Search Term
WA_BDCDATA-FNAM = 'ADDR1_DATA-SORT1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
VendorName
WA_BDCDATA-PROGRAM = 'SAPMF02K'.
WA_BDCDATA-DYNPRO = '0110'.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = 'LFA1-Name1'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Sort Key
WA_BDCDATA-FNAM = 'LFA1-SORTL'.
WA_BDCDATA-FVAL = 'Shou'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Language Key
WA_BDCDATA-FNAM = 'LFA1-SPRAS'.
WA_BDCDATA-FVAL = 'DA'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
Call Transaction 'FK01' using BDCDATA.
ENDFUNCTION.
Regards,
Naimesh
Reward points, if it is useful..!
04-12-2006 12:25 PM
Hi Neimesh,
It works and I hope that the points assignment works.
A last problem, I get this errormessage: Field RM06I-SELKZ. not found in loop of screen SAPMM06I 0103
On the last page. Its a radiobutton I want to mark as checked, use the following code:
WA_BDCDATA-PROGRAM = 'SAPMM06I'.
WA_BDCDATA-DYNPRO = '0103'.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
*CheckBox
WA_BDCDATA-FNAM = 'RM06I-SELKZ'.
WA_BDCDATA-FVAL = 'X'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
04-12-2006 12:44 PM
Hello Mikkel,
May be you have to use the <b>RM06I-SELKZ(01) for the first radiobutton</b>. I am not sure on which screen you are, So, I can nevigate you properly.
Regards,
Naimesh.
04-12-2006 8:18 AM
Do not use SKIP first screen.
Try to fill value in BDC table with corresponding field
OR use
<b>SET PARAMETER ID <pid> FIELD <f>.</b>
This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
regards
vinod