‎2008 Mar 28 5:20 AM
hi,
i am creating a bdc for tcode qp02 for uploading material for plant and group entered....well the problem is the screen where the material data will be inserted is a table control and the table control may or may not contain any previous material data.....the problem i am encountering is when there is already data in table control.how will i know that till which row no. of table control the data is filled and from which row i have to insert the data from flat file.
any useful comments.
shailendra.
‎2008 Mar 28 5:23 AM
‎2008 Mar 28 5:25 AM
Hi Boss...
Point the BDC Cursor and to the table field and
bdc_okcode for the insert new line.
this will move the cursor the line next to the already existing line.
‎2008 Mar 28 5:34 AM
To be exact it should look like something like this.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLKOD-KTEXT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'ANLG'.
This should work..Test and see....
This will insert a new line.after the existing records .I checked it .it works.
‎2008 Mar 28 5:26 AM
‎2008 Mar 28 5:28 AM
hi bharath,
can u elaborate a bit b'coz this is my first encounter with table control bdc.
‎2008 Mar 28 5:50 AM
Hi,
I have just seen the table control that you have mentioned. I think it is of work center assignment. this is the first screen after giving the material and the plant. Here in the menu bar goto EDIT->click Insert line. Embed the bdc recording code. This will prompt you to enter the data from the first line itself.So the previous data also will not be deleted.
Also use the code,
perform bdc_dynpro using 'SAPLCPDI' '1400'.
perform bdc_field using 'BDC_OKCODE'
'=EINF'.
It will work.
Regards,
Sankar.
‎2008 Mar 28 9:09 AM
hi bharath & sanki,
sorry for late reply.
i tried but it didn't worked.well the issue i am facing is if the table control has 14 visible rows in a page and 10 rows are already filled and i have to insert the data from 11 row ,so is there any way so that i can directly get the no. of rows that are already filled (in this case i get 10)....i think starting a counter wouldn't be feasible in cases where no.f rows that are already filled are large.
well sanki,
in th initial screen of qp02 i am not entering the material ,only the plant and group.in the next screen clicking the header -->material assignment --> the table control that appears is the issue.
‎2008 Mar 28 9:26 AM
Hi singh,
I will give you a trick. Just record the BDC to fill the first line when the first record comes. After that pass every record in the second line. You need not go for the total lines displayed in the page.
say for example. Look at the following code.
LOOP AT ITAB1 WHERE MATNR = ITAB-MATNR AND WERKS = ITAB-WERKS.
CNT = CNT + 1.
IF CNT = 1.
PERFORM BDC_DYNPRO USING 'SAPLMDIA' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MKAL-TEXT1(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=DETA'.
PERFORM BDC_FIELD USING 'MKAL-VERID(01)'
ITAB1-VERID. "'0001'.
ELSE.
PERFORM BDC_DYNPRO USING 'SAPLMDIA' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RM03T-AKTZL'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=NEWM'.
PERFORM BDC_DYNPRO USING 'SAPLMDIA' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MKAL-TEXT1(02)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=DETA'.
PERFORM BDC_FIELD USING 'MKAL-VERID(02)'
ITAB1-VERID. "'0003'.
ENDIF.
I have already given a code. In that i have mentioned a function code. its for insert line. whenever you press the 'Insert Line' The cursor will prompt you to the first line. The above code will make you to enter the data in first line when the first record comes and after each records will be passed through the second line. Because the function code for insert line will make the table control to scroll upwards. So our process will be easier. Just try it out at once.
Regards,
Sanki.
‎2008 Mar 28 10:23 AM
hi sanki,
but my table control can have more than one row that is filled.ur solution is for the scenario when only one row is filled ,where i can start inserting the data from the second row.
but in my case it can be 2nd,3rd............
‎2008 Mar 28 10:29 AM
Hi,
Just look at the code. It doesn't a problem how many records you have. I will give an illustration.
When the first record comes.
click the insert line button in the menu bar. So the first record will be passed into the first line as like follows.
10 first record.
20
30
40
when the second record comes again click the insert line option. also write the cursor in the second row position.so the will be passed to the second line as folllows.
10 first record.
20 second record.
30
40
Then the third record comes,again click the insert line option. also write the cursor in the second row position by the table control will scroll upwards . so the will be passed to the second line as folllows.
10 second record.
20 third record.
30
40
Then do the same thing for the following records. Then the fourth record will be.
10 third record.
20 fourth record.
30
40
After the completion of the BDCyou can visualize the effect.
Regards,
Sanki.
‎2008 Mar 28 10:49 AM
hi sanki,
thank for the help,but still the issue is that the insert line code which u had provided
perform bdc_field using 'BDC_OKCODE'
'=EINF'.
is not working ,so i am not able to place a insert line and then insert the data at first row as u had mentioned.so,i am still at the start of the problem.