ā2013 Nov 27 5:26 AM
Hi friends,
I have flat file with 35 records.but in the bdc it hold only for first screen like 16 data . I need to upload all the data .
I need some one help pls ..
After the execution value is like this .
it's hold only 16 like this ...
How to i solve pls give some solvation .
Thanks & Regards
Ram
ā2013 Nov 27 5:32 AM
Hi Ram
Can you please upload your screenshots again..? Are you doing this in a table control if yes... then in your code after a certain record count you will need to press page down. In order to understand what i am saying please create a recording for these 35 records you will get it from recording
Nabheet
ā2013 Nov 27 5:32 AM
Hi Ram
Can you please upload your screenshots again..? Are you doing this in a table control if yes... then in your code after a certain record count you will need to press page down. In order to understand what i am saying please create a recording for these 35 records you will get it from recording
Nabheet
ā2013 Nov 27 5:42 AM
ā2013 Nov 27 5:44 AM
Ram the reason is at one go only 16 lines can come so after 16 lines in your loop you need to add BDC OK_CODE for PAGE DOWN so that blank table control comes. You need to reset your counter also as it will start again from 1 not from 17
Nabheet
ā2013 Nov 27 5:50 AM
Nabheet,
am not set any thing regarding the line .this loop also based on the flat file .
Thanks & Regards
Ram
ā2013 Nov 27 6:39 AM
Hi-
What Nabheet said was correct.
As you can see in your recording at a time only 16 items can be inserted. So what you have to do is capture the ok_code for page down ad write down the logic like below:
* If your line items count is > 16 i.e, for 17th line item use ok_code for page down and the same applies for every 16 items.
-Venkat
ā2013 Nov 27 7:06 AM
ā2013 Nov 27 7:09 AM
ā2013 Nov 27 7:09 AM
Hi Ram
Few things
COUNT should be cleared again after it becomes equal to 16. I am assuming you are incrementing the count at the begginning..
Check in foreground mode what happens.
Nabheet
ā2013 Nov 27 7:33 AM
ā2013 Nov 27 7:39 AM
hi nabheet madan,
I check it but value is not assign only the space,
And one thing ,
when count >16 and clear count,okcode is p+
that the time it will overlap
when count = 16 and clear count,okcode is p+
that the time it will overlap
when count = 16 and clear count,okcode is vw+
that the time it will give space
when count > 16 and clear count,okcode is vw+
that the time it will give space
Thanks & Regards
Ram
ā2013 Nov 27 7:42 AM
Ram easiest way for you to understand this stuff will be create a recording of 20 line items in SHDB. then you will come to know what is the OK code for page down . What is this VW+?
Nabheet
ā2013 Nov 27 5:36 AM
Hello Ramkumar,
Are you trying to update in table in the screen? If yes. Please check table control in BDC.
Depends upon screen resolution, system displays no. of rows in the table control.
Regards,
Muthukumar.K
ā2013 Nov 27 5:46 AM
Hi Muthukumar.K,
this is my code pls check this..
report ZRAM_VC_BDC1
no standard page heading line-size 255.
TYPES : BEGIN OF ty_ekpo,
ematn TYPE ekpo-ematn,
menge TYPE ekpo-menge,
NETPR TYPE EKPO-NETPR,
END OF ty_ekpo,
BEGIN OF ty_ekko,
LIFNR TYPE EKKO-LIFNR ,
EKORG TYPE EKKO-EKORG,
EKGRP TYPE EKKO-EKGRP,
po_org TYPE ekko-EKORG,
grp TYPE EKKO-EKGRP,
po_type TYPE RM06E-BSART,
po_date TYPE RM06E-BEDAT,
plant TYPE RM06E-WERKS,
END OF ty_ekko.
data : it_EKPO TYPE TABLE OF TY_ekPo,
WA_EKPO TYPE TY_EKPO,
it_ekko TYPE TABLE OF ty_ekko,
wa_ekko TYPE ty_ekko,
IT_BDC TYPE TABLE OF BDCDATA,
WA_BDC TYPE BDCDATA,
IT_FLAT TYPE TABLE OF ALSMEX_TABLINE,
wa_flat TYPE ALSMEX_TABLINE,
row TYPE i,
count TYPE string,
tcontrol(125) type c ,
P TYPE RLGRAP-FILENAME.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
PARAMETERS p_file TYPE IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1 .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = p_file
.
P = P_FILE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p
i_begin_col = 1
i_begin_row = 2
i_end_col = 8
i_end_row = 9999
TABLES
intern = it_FLAT
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
.
CHECK NOT it_flat[] is INITIAL.
LOOP AT it_flat INTO wa_flat.
CASE wa_flat-col.
when 1.
wa_EKKO-LIFNR = wa_flat-value.
when 2.
wa_ekko-po_type = wa_flat-value.
when 3.
wa_ekko-po_date = wa_flat-value.
when 4.
wa_ekko-po_org = wa_flat-value.
when 5.
wa_ekko-grp = wa_flat-value.
when 6.
wa_ekko-plant = wa_flat-value.
WHEN 7.
WA_EKPO-ematn = wa_flat-value.
WHEN 8.
WA_EKPO-MENGE = wa_flat-value.
WHEN 9.
WA_EKPO-NETPR = WA_FLAT-VALUE.
ENDCASE.
at END OF row.
APPEND wa_ekpo to it_ekpo.
CLEAR : wa_ekpo.
ENDAT.
ENDLOOP.
START-OF-SELECTION.
perform bdc_dynpro using 'SAPMM06E' '0100'.
perform bdc_field using 'BDC_CURSOR'
wa_EKKO-LIFNR..
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EKKO-LIFNR'
wa_EKKO-LIFNR. "T-K515A07
perform bdc_field using 'RM06E-BSART' "'ZYNB'
wa_ekko-po_type.
perform bdc_field using 'RM06E-BEDAT'
wa_ekko-po_date.
perform bdc_field using 'EKKO-EKORG' "1000
wa_EKKO-po_org.
perform bdc_field using 'EKKO-EKGRP' "'001'.
wa_ekko-grp.
perform bdc_field using 'RM06E-LPEIN'
'T'.
perform bdc_field using 'RM06E-WERKS'
wa_ekko-plant. "'1000'.
LOOP AT IT_EKPO INTO WA_EKPO.
COUNT = COUNT + 1.
perform bdc_dynpro using 'SAPMM06E' '0120'.
CLEAR tcontrol.
CONCATENATE 'EKPO-EMATN(' count ')' INTO tcontrol.
perform bdc_field using 'BDC_CURSOR' tcontrol.
perform bdc_field using 'BDC_OKCODE'
'/00'.
CLEAR tcontrol.
CONCATENATE 'EKPO-EMATN(' count ')' INTO tcontrol.
perform bdc_field using tcontrol WA_EKPO-EMATN.
CLEAR tcontrol.
CONCATENATE 'EKPO-MENGE(' count ')' INTO tcontrol.
perform bdc_field using tcontrol
WA_EKPO-MENGE.
CLEAR tcontrol.
CONCATENATE 'EKPO-NETPR(' count ')' INTO tcontrol.
perform bdc_field using tcontrol WA_EKPO-NETPR.
ENDLOOP.
perform bdc_dynpro using 'SAPMM06E' '0120'.
CLEAR tcontrol.
CONCATENATE 'EKPO-EMATN(' count ')' INTO tcontrol.
perform bdc_field using 'BDC_CURSOR' tcontrol.
*
*perform bdc_field using 'BDC_CURSOR'
* 'EKPO-EMATN(01)'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'RM06E-EBELP'
'10'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_field using 'BDC_OKCODE'
'=NP'.
CALL TRANSACTION 'ME21' USING IT_BDC MODE 'A'.
form BDC_DYNPRO using value(p_0090)
value(p_0091).
*perform close_group.
*&---------------------------------------------------------------------*
*& Form BDC_DYNPRO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0090 text
* -->P_0091 text
*----------------------------------------------------------------------*
wa_bdc-program = p_0090.
wa_bdc-dynpro = p_0091.
WA_BDC-DYNBEGIN = 'X'.
APPEND WA_BDC TO IT_BDC.
CLEAR WA_BDC.
endform.
*&---------------------------------------------------------------------*
*& Form BDC_FIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0105 text
* -->P_0106 text
*----------------------------------------------------------------------*
form BDC_FIELD using value(p_0105)
value(p_0106).
wa_bdc-fnam = p_0105.
wa_bdc-fval = p_0106.
CONDENSE WA_BDC-FVAL.
APPEND WA_BDC TO IT_BDC.
CLEAR WA_BDC .
endform. " BDC_FIELD
Thanks & Regards
Ram
ā2013 Nov 27 5:53 AM
Hello Ramkumar,
You need to increment the count from 16.
and you can use ok_code as PAGE DOWN after every increment.
Regards,
Muthukumar
ā2013 Nov 27 6:02 AM
HI Muthukumar,
I already tryed this way but it's not work .
pls once execute and fix this problem .
Regards
Ram.
ā2013 Nov 27 6:25 AM
Hi Ramkumar K
Why you are using ME21 old transaction, Why you can use New transaction is ME21N.
And create BDC or BAPI BAPI_PO_CREATE1
Other while recording in SHDB enter 18 items and write program.
In your code screen increment was nod done...
ā2013 Nov 27 6:57 AM
Hi Ramkumar,
Try modifying the code as shown with underline -
LOOP AT IT_EKPO INTO WA_EKPO.
COUNT = COUNT + 1.
perform bdc_dynpro using 'SAPMM06E' '0120'.
CLEAR tcontrol.
CONCATENATE 'EKPO-EMATN(' count ')' INTO tcontrol.
perform bdc_field using 'BDC_CURSOR' tcontrol.
perform bdc_field using 'BDC_OKCODE'
'/00'.
CLEAR tcontrol.
CONCATENATE 'EKPO-EMATN(' count ')' INTO tcontrol.
perform bdc_field using tcontrol WA_EKPO-EMATN.
CLEAR tcontrol.
CONCATENATE 'EKPO-MENGE(' count ')' INTO tcontrol.
perform bdc_field using tcontrol
WA_EKPO-MENGE.
CLEAR tcontrol.
CONCATENATE 'EKPO-NETPR(' count ')' INTO tcontrol.
perform bdc_field using tcontrol WA_EKPO-NETPR.
if count eq 16.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
clear count.
endif.
ENDLOOP.
BR.
ā2013 Nov 27 7:25 AM
ā2013 Nov 27 7:22 AM
HI ram ,
you will batter use BAPI_PO_CREATE1, so no any problem like that
so you try to upload using BAPI.
ā2013 Nov 27 7:29 AM
Hi shyam d ,
It's passible inside of bdc.
if yes means pls check my program or give some example .
Thanks & Regards
Ram
ā2013 Nov 27 7:31 AM
Hi Ram
Please make sure you are using same count variable which you are clearing after page down. from the error it looks like for NETPR you are using some different count? that is why it got 18 as a coount where as it should have been to the max 16
Nabheet
ā2013 Nov 27 7:44 AM
ā2013 Nov 27 7:47 AM
Ram
Please create a recording.. The issue is with your counter only...
Yes plus what has been suggested by sumit sharma check that also..
Nabheet
ā2013 Nov 27 9:18 AM
Hi Ram,
There can be two possibilities,
1) Either you are coding it improperly. Sample programs for the same can be referred here -
http://www.gotothings.com/abap/handling-table-control-in-bdc.htm &
http://www.erpgreat.com/abap/bdc-example-using-table-control-in-bdc.htm
2) 'Ok code' used in program is not correct. For this do a recording of line items exceeding a single page and then press Page Down, enter values and click save. Then check the Ok Code for the same in recording. Now code an 'If' condition appropriately.
Also as suggested by Ramesh, the best way is to use BAPIs because BDC is highly configuration dependent and if the sequence of screens or any soft config changes, BDC should be tweaked.
BR.
ā2013 Nov 27 7:47 AM
Hi Ram,
On Page-Down, Please check if the next entries starts from first line or second line.
I mean on pressing the Page-Down, check if the first line is filled with record 160. If this is the case, then you have to pass COUNT = 2. Check the below code:
COUNT = 1.
LOOP AT IT_EKPO INTO WA_EKPO.
IF COUNT > 16.
COUNT = 1 or COUNT = 2. " Check if on Page Down last line item appears
on first line. If it appears, then COUNT = 2.
ENDIF.
all the code is same...
COUNT = COUNT + 1. " Increase this counter just above the ENDLOOP.
ENDLOOP.
Hope it helps....
Thanks,
Sumit
ā2013 Nov 27 8:08 AM
Hi Ramkumar
i think no need to record the page down button since the screen for PO item is a table
the way you are handling is correct
what i observed in you program is you are using tcontrol variable
form BDC_FIELD using value(p_0105)
value(p_0106).
wa_bdc-fnam = p_0105.
wa_bdc-fval = p_0106.
CONDENSE WA_BDC-FVAL.
APPEND WA_BDC TO IT_BDC.
CLEAR WA_BDC .
endform. " BDC_FIELD
in the above code u written condense statement
in one scenario you are tcontrol as FVAL
and in another case you are passing tcontrol as FNAM
you can check
try to run the bdc in foreground for 17 items and less than 16 items
i think you will find the logical error
Thanks
Pawan Akella
ā2013 Nov 27 8:25 AM
Also put the page down code as above the
COUNT = 1.
LOOP AT IT_EKPO INTO WA_EKPO.
IF COUNT > 16.
COUNT = 1 or COUNT = 2. " Check if on Page Down last line item appears
on first line. If it appears, then COUNT = 2.
ENDIF.
all the code is same...
if count = 16.
code of Page down...
endif.
COUNT = COUNT + 1. " Increase this counter just above the ENDLOOP.
ENDLOOP.
ā2013 Nov 27 9:49 AM
Hi Friends,
Thanks for all ..
My Final Madification Is
Thanks & Regards
Ram