How to handle table selection
In the uix guidelines i found the following example on how to handle table selection:
public static EventResult doSelectionEvent(BajaContext bc, Page page,
PageEvent event)
DataObject tableRows = new PageEventFlattenedDataSet(event, "table1");
int index = SelectionUtils.getSelectedIndex(tableRows);
String name = "Nothing Selected";
// make sure that something was selected:
if (index>=0)
DataObject row = TABLEDATA.getItem(index);
name = row.selectValue(null, "name").toString();
EventResult result = new EventResult(page);
result.setProperty("action", event.getName());
result.setProperty("name", name);
return result;
It is not clear to me what TABLEDATA is.
I read in some other thread that it is a DataObjectList and it represents the 'stored dataObjects'.
I suppose '_TABLE_DATA' is not real code, may i ask for an example with real code to understand what it is?
Thanks.
This code works for me, I hope it is useful.
(NB: i fear you will not read correctly the line
with the getRowAtRangeIndex instruction. It's a problem with the editor).
Mauro
package view;
import javax.servlet.http.HttpServletRequest;
import oracle.adf.controller.struts.actions.DataActionContext;
import oracle.adf.controller.struts.actions.DataForwardAction;
import oracle.cabo.ui.beans.table.SelectionUtils;
import oracle.cabo.ui.data.ServletRequestDataSet;
import oracle.jbo.ApplicationModule;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
public class GestEsAction extends DataForwardAction
// To handle an event named "yourname" add a method:
// public void onYourname(DataActionContext ctx)
public void onValida(DataActionContext ctx)
ServletRequestDataSet ds = new ServletRequestDataSet(req,"ReEsamiRichView12");
int[] indices = SelectionUtils.getSelectedIndices(ds);
ApplicationModule am = ctx.getBindingContainer().
getApplicationModule();
ViewObject vo = am.findViewObject("ReEsamiRichView1");
int len = indices.length;
String idEsameRich, currStato;
for(int i=0; i<len; i++)
Row row = vo.getRowAtRangeIndex(indices);
idEsameRich = row.getAttribute("IdEsameRich").toString();
currStato = row.getAttribute("Stato").toString();
if (currStato.equals("E"))
row.setAttribute("Stato","V");
am.getTransaction().commit();
// To override a method of the lifecycle, go to
// the main menu "Tools/Override Methods...".
Similar Messages
-
How to handle Table controls with XD01 in BDC
How to handle Table controls with XD01 in BDC - If there are more than 5/6 records in Table control. - Can any one explain it with a piece of code plz..
Thanks & Regards,
Krishna ChaitanyaHi
check this code...viz for xko1....
DATA: BEGIN OF it_xk01 OCCURS 0,
f1(1),
f2(5),
f3(5),
f4(9),
f5(9),
END OF it_xk01.
DATA: v_count(2) VALUE '00',
v_koinh(14),
v_banks(14),
v_bankn(14),
v_bankl(14),
it_bdcdata TYPE STANDARD TABLE OF bdcdata WITH HEADER LINE,
wa_ctuparams type ctu_params.
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM get_f4.
START-OF-SELECTION.
PERFORM upload_data.
END-OF-SELECTION.
LOOP AT it_xk01.
IF it_xk01-f1 = 'H'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-KTOKK'
it_xk01-f2.
ENDIF.
IF it_xk01-f1 = 'N'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-PSTLZ'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFA1-ANRED'
'Mr'.
PERFORM bdc_field USING 'LFA1-NAME1'
it_xk01-f2.
PERFORM bdc_field USING 'LFA1-SORTL'
it_xk01-f3.
PERFORM bdc_field USING 'LFA1-PSTLZ'
it_xk01-f4.
PERFORM bdc_field USING 'LFA1-LAND1'
it_xk01-f5.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
ENDIF.
IF it_xk01-f1 = 'I'.
v_count = v_count + 1.
IF v_count le 5.
CONCATENATE 'LFBK-KOINH(' v_count ')' INTO v_koinh.
CONCATENATE 'LFBK-BANKS(' v_count ')' INTO v_banks.
CONCATENATE 'LFBK-BANKN(' v_count ')' INTO v_bankn.
CONCATENATE 'LFBK-BANKL(' v_count ')' INTO v_bankl.
CONDENSE v_koinh NO-GAPS.
CONDENSE v_banks NO-GAPS.
CONDENSE v_bankl NO-GAPS.
CONDENSE v_bankn NO-GAPS.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_koinh.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING v_banks
it_xk01-f2.
PERFORM bdc_field USING v_bankl
it_xk01-f3.
PERFORM bdc_field USING v_bankn
it_xk01-f4.
PERFORM bdc_field USING v_koinh
it_xk01-f5.
else.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_koinh.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
v_count = 1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_koinh.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CONCATENATE 'LFBK-KOINH(' v_count ')' INTO v_koinh.
CONCATENATE 'LFBK-BANKS(' v_count ')' INTO v_banks.
CONCATENATE 'LFBK-BANKN(' v_count ')' INTO v_bankn.
CONCATENATE 'LFBK-BANKL(' v_count ')' INTO v_bankl.
CONDENSE v_koinh NO-GAPS.
CONDENSE v_banks NO-GAPS.
CONDENSE v_bankl NO-GAPS.
CONDENSE v_bankn NO-GAPS.
PERFORM bdc_field USING v_banks
it_xk01-f2.
PERFORM bdc_field USING v_bankl
it_xk01-f3.
PERFORM bdc_field USING v_bankn
it_xk01-f4.
PERFORM bdc_field USING v_koinh
it_xk01-f5.
ENDIF.
ENDIF.
CLEAR it_xk01.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_koinh.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
wa_ctuparams-DISMODE = 'A'.
wa_ctuparams-UPDMODE = 'S'.
wa_ctuparams-DEFSIZE = 'X'.
CALL TRANSACTION 'XK01' USING it_bdcdata MODE 'A'
UPDATE 'S'.
options from wa_ctuparams.
MODE 'A'
UPDATE 'S'.
*& Form upload_data
text
FORM upload_data .
DATA: lv_infile TYPE string.
lv_infile = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_infile
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_xk01.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " upload_data
*& Form get_f4
text
FORM get_f4 .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = ' '
IMPORTING
file_name = p_file.
ENDFORM. " get_f4
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR it_bdcdata.
it_bdcdata-program = program.
it_bdcdata-dynpro = dynpro.
it_bdcdata-dynbegin = 'X'.
APPEND it_bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF FVAL <> NODATA.
CLEAR it_bdcdata.
it_bdcdata-fnam = fnam.
it_bdcdata-fval = fval.
APPEND it_bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
*H 0302
*N sdng dddsj 500020 IN
*I IN ICICI 734897597 xyz
*I IN SBH 768346687 abc
*I IN SBI 345687346 fgh
*I IN SBH 763846878 ujhgf
*I IN HSBC 797893778 fvdg
*I IN HDFC 723678638 fdgf
*I IN 4444 435645646 fgfg
*I IN 3400 763468768 gfgfg -
Hi abapers how to handle table control in bdc
hi experts please guide me
how to handle table control in bdc? could u please explain me briefly
thanks and regardssayeed,
Go thru this code it may help you. check bold code for the table control..
report zsunil_bdc
no standard page heading line-size 255.
INTERNAL TABLES *
DATA: BEGIN OF IT_KNA1 OCCURS 0,
CUSTOMER LIKE RF02D-KUNNR,
COMPANY_CODE LIKE RF02D-BUKRS,
ACCOUNT_GROUP LIKE RF02D-KTOKD,
TITLE LIKE KNA1-ANRED,
NAME LIKE KNA1-NAME1,
SEARCH_TERM LIKE KNA1-SORTL,
STREET LIKE KNA1-STRAS,
CITY LIKE KNA1-ORT01,
POSTAL_CODE LIKE KNA1-PSTLZ,
COUNTRY LIKE KNA1-LAND1,
LANGUAGE_KEY LIKE KNA1-SPRAS,
CNTRY LIKE KNBK-BANKS,
BANK_KEY LIKE KNBK-BANKL,
BANK_ACCOUNT LIKE KNBK-BANKN,
REC_ACCOUNT LIKE KNB1-AKONT,
END OF IT_KNA1.
DATA: IT_BDCDATA TYPE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: IT_MESSAGES TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER P_FILE TYPE RLGRAP-FILENAME DEFAULT 'C:\CUSTOMER.TXT'
OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION SCREEN *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM HELP_FILE USING P_FILE.
START OF SELECTION *
START-OF-SELECTION.
*UPLOADING THE FILE FROM WORKSTATION
PERFORM UPLOAD_FILE USING P_FILE.
*POPULATING DATA.
PERFORM POPULATE_FILE.
*& Form HELP_FILE
text
-->P_P_FILE text
form HELP_FILE using p_p_file.
DATA: L_FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE.
P_P_FILE = L_FILE.
endform. " HELP_FILE
*& Form UPLOAD_FILE
text
-->P_P_FILE text
form UPLOAD_FILE using p_p_file.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'P_P_FILE'
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
data_tab = IT_KNA1
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " UPLOAD_FILE
*& Form POPULATE_FILE
text
--> p1 text
<-- p2 text
form POPULATE_FILE .
DATA: L_STRING TYPE STRING,
L_COUNTER(2) TYPE N,
V_INDEX TYPE SY-TABIX.
LOOP AT IT_KNA1.
V_INDEX = SY-TABIX.
AT NEW CUSTOMER.
READ TABLE IT_KNA1 INDEX V_INDEX.
IF SY-SUBRC = 0.
perform bdc_dynpro using 'SAPMF02D' '0105'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KTOKD'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
IT_KNA1-CUSTOMER.
perform bdc_field using 'RF02D-BUKRS'
IT_KNA1-COMPANY_CODE.
perform bdc_field using 'RF02D-KTOKD'
IT_KNA1-ACCOUNT_GROUP.
*PERFORM BDC_FIELD USING 'RF02D-D0130'
'X'.
perform bdc_dynpro using 'SAPMF02D' '0110'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-ANRED'
IT_KNA1-TITLE.
perform bdc_field using 'KNA1-NAME1'
IT_KNA1-NAME.
perform bdc_field using 'KNA1-SORTL'
IT_KNA1-SEARCH_TERM.
perform bdc_field using 'KNA1-STRAS'
IT_KNA1-STREET.
perform bdc_field using 'KNA1-ORT01'
IT_KNA1-CITY.
perform bdc_field using 'KNA1-PSTLZ'
IT_KNA1-POSTAL_CODE.
perform bdc_field using 'KNA1-LAND1'
IT_KNA1-COUNTRY.
perform bdc_field using 'KNA1-SPRAS'
IT_KNA1-LANGUAGE_KEY.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
PERFORM BDC_FIELD USING 'RF02D-D0130'
'X'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKN(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0210'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'KNB1-AKONT'
IT_KNA1-REC_ACCOUNT.
perform bdc_dynpro using 'SAPLRSFH' '0100'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'RSIODYNP4-LOW(01)'.
ENDIF.
ENDAT.
L_COUNTER = L_COUNTER + 1.
CLEAR L_STRING.
CONCATENATE 'KNBK-BANKS(' L_COUNTER ')' INTO L_STRING.
PERFORM BDC_FIELD USING L_STRING
IT_KNA1-CNTRY.
CLEAR L_STRING.
CONCATENATE 'KNBK-BANKL(' L_COUNTER ')' INTO L_STRING.
PERFORM BDC_FIELD USING L_STRING
IT_KNA1-BANK_KEY.
CLEAR L_STRING.
CONCATENATE 'KNBK-BANKN(' L_COUNTER ')' INTO L_STRING.
PERFORM BDC_FIELD USING L_STRING
IT_KNA1-BANK_ACCOUNT.
AT END OF CUSTOMER.
READ TABLE IT_KNA1 INDEX V_INDEX.
IF SY-SUBRC = 0.
CALL TRANSACTION 'FD01' USING IT_BDCDATA MODE 'A' UPDATE 'S' MESSAGES
INTO IT_MESSAGES.
IF SY-SUBRC <> 0.
PERFORM EMPLOYEEID_ERROR.
*ELSE.
ENDIF.
WRITE: SY-SUBRC.
perform message_format_write.
*ENDIF.
*WRITE: SY-SUBRC.
CLEAR IT_BDCDATA.
REFRESH IT_BDCDATA.
ENDIF.
ENDAT.
ENDLOOP.
endform. " POPULATE_FILE
*& Form bdc_dynpro
text
-->P_0224 text
-->P_0225 text
form bdc_dynpro using value(p_0224)
value(p_0225).
IT_BDCDATA-PROGRAM = P_0224.
IT_BDCDATA-DYNPRO = P_0225.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
CLEAR IT_BDCDATA.
endform. " bdc_dynpro
*& Form bdc_field
text
-->P_0229 text
-->P_0230 text
form bdc_field using value(p_0229)
value(p_0230).
IT_BDCDATA-FNAM = P_0229.
IT_BDCDATA-FVAL = P_0230.
APPEND IT_BDCDATA.
CLEAR IT_BDCDATA.
endform. " bdc_field
*& Form EMPLOYEEID_ERROR
text
--> p1 text
<-- p2 text
form EMPLOYEEID_ERROR .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = 'Z50583_REC1'
HOLDDATE = FILLER8
KEEP = 'X'
USER = SY-UNAME
RECORD = FILLER1
PROG = SY-CPROG
IMPORTING
QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'FD01'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
dynprotab = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " EMPLOYEEID_ERROR
*& Form message_format_write
text
--> p1 text
<-- p2 text
form message_format_write .
DATA: L_MSG(200).
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = SY-LANGU
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
WRITE: / L_MSG.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " message_format_write
~~Guduri -
How to handle multiple selection in the Spark List control with checkbox as itemrenderer?
Hi All,
I am using checkbox as an ItemRenderer in spark list.
I have a query.
how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
how to retrieve the selected item label?
Thank you in advance.Hi there, I'll tweak your code a little bit to something like this:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
import mx.controls.CheckBox;
[Bindable]
private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
private function onChange(e:ListEvent):void
if(CheckBox(e.itemRenderer).selected){
mySelectedIndexes.addItem(e.rowIndex);
}else{
mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));
chkList.selectedIndices=mySelectedIndexes.toArray();
]]>
</mx:Script>
<mx:ArrayCollection id="collection">
<mx:Object label="Test A"/>
<mx:Object label="Test B"/>
<mx:Object label="Test C"/>
<mx:Object label="Test D"/>
<mx:Object label="Test E"/>
<mx:Object label="Test F"/>
<mx:Object label="Test G"/>
</mx:ArrayCollection>
<mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox" itemClick="onChange(event);" allowMultipleSelection="true"/>
</mx:Application> -
How to handle table control in BDC while uploading item details for anorder
How to handle table control in BDC while uploading item details for an order?
What is the use of CTU_PARAMS structure in BDC?
In Finance I have done some changes to the layout set by coping to a zscript(duning letter) and how can assign the print program?
What is the process to test the finance script?
How can I see the print preview whether it is coming correctly or not?
Thanks in advance.
Regards.
Abhilash.hi,
for the bdc control refer the following link:
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
ctu_params:
refer to the link
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/dataTransfers-LSMW%2CALE%2C+BDC
reward if useful,
thanks and regards -
How to handle Table control in BDC
How to handle Table control in BDC
HI,
Table Control in BDC
HI,
Refer the link:
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
The concept is easy: it has to indicate the index of the table control in the field name, so if you have to populate the first record of table control:
BDC-FIELDNAME = <FIELDNAME>(01).
If you fill the second row:
BDC-FIELDNAME = <FIELDNAME>(02).
and so....
Now the problem is usually on how many records you have to load, because u can fill only the rows of table control available in the screen, If you have more records than it can be displayed yuo have to simulate the command to go next page.
The number of recod can be displayed can depend on pc resolution and many program haven't command to go to next page (in this case it could be impossible create a BDC program9.
A way to create a bdc program resolution indipendent is to work on the first and second row.
- Place the first hit in the first row of bdc;
- Place the second insert in the second row of bdc;
- Place the last hit to the top of table control;
- Place the next hit in the second row;
- Place the last hit to the top of table control;
- Place the next hit in the second row;
- .... and so
For more info: Search in SDN with TABLE CONTROL IN BDC.
Will get a lot of related links.
<b>Reward points if this Helps.
Manish</b> -
How to handle table control in lsmw recording method
hi expert please tell me the procedure for how to handle table control in lsmw recording method
Locked for same reason as how to upload data for me01 using LSMW BDC METHOD
Edited by: Matt on May 9, 2011 8:52 AMSri,
just search in SDN search box by giving table control in lsmw you will get hell lot of threads for same.
Amit. -
How to handle Table control in BDC? Difference between BDC & LSMW?
Hi
How to handle Table control in BDC? Difference between BDC & LSMW?
Regards,
RaghuHi ,
the diff b/w normal BDC and with table control is that with table control u can enter as many lineitems as u want..so during recording if u r entering 3 line items..then the program will show (1), (2) and (3) with that.
chane that fixed no to variable.
check that sample code.
in this for new customer...any no of items can be entered.
LOOP AT t_cusdata.
REFRESH t_bdcdata.
ON CHANGE OF t_cusdata-kunnr.
initial screen.
PERFORM bdc_dynpro USING 'SAPMV10A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MV10A-VTWEG'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MV10A-KUNNR'
t_cusdata-kunnr.
PERFORM bdc_field USING 'MV10A-VKORG'
t_cusdata-vkorg. "'HCL'.
PERFORM bdc_field USING 'MV10A-VTWEG'
t_cusdata-vtweg. "'HL'.
DATA: fnam(20) TYPE c,
fnam1(20) TYPE c,
idx(2) TYPE c.
MOVE 1 TO idx.
LOOP AT t_matdata WHERE kunnr = t_cusdata-kunnr.
PERFORM bdc_dynpro USING 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-KDMAT(' idx ')' INTO fnam.
PERFORM bdc_field USING 'BDC_CURSOR'
fnam.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CONCATENATE 'MV10A-MATNR(' idx ')' INTO fnam1.
PERFORM bdc_field USING fnam1
t_matdata-matnr. "'FIN50'.
PERFORM bdc_field USING fnam
t_matdata-kdmat. "'ABCD'.
idx = idx + 1.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMV10A' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MV10A-MATNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VD51' USING t_bdcdata MODE 'A' .
UPDATE 'S' MESSAGES INTO t_err_mes.
Regards,
Sonika -
How to handle the selected record
how to handle the selected record when using alv classes
Hi,
use method : get_current_cell
CALL METHOD grid1->get_current_cell
IMPORTING es_row_id = ls_row_id
es_col_id = ls_col_id
e_value = l_value. -
How to handle table type record in OAF
Hi ,
Req:
There is a search page that can be accessed from different locations .
The result set should be different when accessed from each location .
Approach to be used :
Call a PL/SQL api which returns a table type input parameter for different search conditions . Each record that is returned by the table type input needs to be iterated and a new row should be created in a transtient VO to show results on the UI
Problem :
How to handle to table type input returned from pl/sql in java and show the results?
Thanks in advance.There is a requirement to fetch records from cursor into a collection .Following is the code snippet that I have used.
/** creating an object **/
CREATE OR REPLACE TYPE XXCRM_GBL_DSW_AUDIT_RSTLS_O_TP AS OBJECT (
CUSTOMER_NAME VARCHAR2(360),
PROJECT_NAME VARCHAR2(40),
BOARD_NAME VARCHAR2(40),
ARROW_UNIQUE_NO NUMBER,
FIELD_NAME VARCHAR2(2000),
OLD_VALUE VARCHAR2(2000),
NEW_VALUE VARCHAR2(2000),
USER_ID NUMBER,
USER_NAME VARCHAR2(100),
AUDIT_DATE DATE,
AUDIT_TYPE VARCHAR2(1),
SUPP_SYS_LAST_UPDATE_ON DATE,
SUPP_TRACKING_NUM VARCHAR2(50),
CONSTRUCTOR FUNCTION XXCRM_GBL_DSW_AUDIT_RSTLS_O_TP
RETURN SELF AS RESULT
/** initializing the object **/
CREATE OR REPLACE TYPE BODY XXCRM_GBL_DSW_AUDIT_RSTLS_O_TP IS
CONSTRUCTOR FUNCTION XXCRM_GBL_DSW_AUDIT_RSTLS_O_TP
RETURN SELF AS RESULT IS
BEGIN
self.customer_name := fnd_api.g_miss_char;
self.project_name := fnd_api.g_miss_char;
self.board_name := fnd_api.g_miss_char;
self.arrow_unique_no := fnd_api.g_miss_num;
self.field_name := fnd_api.g_miss_char;
self.old_value := fnd_api.g_miss_char;
self.new_value := fnd_api.g_miss_char;
self.user_id := fnd_api.g_miss_num;
self.user_name := fnd_api.g_miss_char;
self.audit_date := fnd_api.g_miss_date;
self.audit_type := fnd_api.g_miss_char;
self.supp_sys_last_update_on := fnd_api.g_miss_date;
self.supp_tracking_num := fnd_api.g_miss_char;
return;
END;
END;
/** creating a collection of object**/
CREATE TYPE XXCRM_GBL_DSW_AUDIT_RSTLS_C_TP AS TABLE OF XXCRM_GBL_DSW_AUDIT_RSTLS_O_TP;
/**Inside the package body **/
CURSOR c_proj_cur is
SELECT NULL CUSTOMER_NAME,
(SELECT project_name
FROM xxcrm_gbl_dsw_projects_all
WHERE project_id = xgda.project_id) PROJECT_NAME,
DECODE(xgda.board_id,NULL,'test',
(SELECT board_name
FROM xxcrm_gbl_dsw_boards_all
WHERE board_id = xgda.board_id)) BOARD_NAME,
DECODE(xgda.internal_dwr_id,
NULL,NULL,
(SELECT internal_dwr_id
FROM xxcrm_gbl_dsw_regstrations_all
WHERE internal_dwr_id = xgda.internal_dwr_id)) ARROW_UNIQUE_NO,
fielslu.meaning FIELD_NAME,
xgda.old_value OLD_VALUE,
xgda.new_value NEW_VALUE,
xgda.created_by USER_ID,
'kuldeep' USER_NAME,
xgda.Creation_Date AUDIT_DATE,
xgda.audit_Level AUDIT_TYPE,
SYSDATE SUPP_SYS_LAST_UPDATE_ON,
't001' SUPP_TRACKING_NUM
FROM XXCRM_GBL_DSW_AUDIT_ALL xgda ,
FND_LOOKUP_VALUES_VL fielslu
WHERE xgda.project_id =174
AND fielslu.lookup_type = 'XXCRM_DSW_REV_FIELD_NAMES'
AND fielslu.lookup_code = xgda.FIELD_NAME
AND enabled_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(fielslu.start_date_active,sysdate))
AND TRUNC(NVL(fielslu.end_date_active,sysdate))
ORDER BY xgda.creation_date;
Tab XXCRM_GBL_DSW_AUDIT_RSTLS_C_TP ;
BEGIN
OPEN c_proj_cur;
LOOP
FETCH c_proj_cur BULK COLLECT INTO tab; --ERROR type mismatch found at 'TAB' between FETCH cursor and INTO variables
END LOOP;
END;
/**Error */
When the above script is executed it gives an error “type mismatch found at 'TAB' between FETCH cursor and INTO variables” (at line highlighted above).
I have validated the data type of cursor and object too. But still the error is not resolved .
Did anyone of you come across a similar requirement, fetching the values from cursor into a collection? Please help. -
How to handle table controls using LSMW
Hi All,
how to use LSMW to handle table control like header and item details eg. VA01 , ME21 etc. To handle these kind of trnasactions can we use LSMW instead BDC to upload data. Please let me know.
Thanks in advance.
Regards,
KalpanaHi Kalpana,
You can have your own custom programs for LSMW if the standard DI/BI IDOC , BAPI dont meet your requirements.
Its little bit complex. You need to register you custom program in table through SM30.
SDX0 - Program Definition ( BI or DI )
SDX1 - Program Assignment
SDX2 - Declaring Structures
SDX3 - Declaring field identifiers for structures
You can goto SM30 and can view the standard BI/DI programs definition by using the four digit Obejct Number...
<b>AS</b> -
How to handle tables having volatile data
Hi,
We have a table in which we load millions of data and after validation a huge amount of data is deleted. After that the select statements (performing FTS) becomes slow. If we shrink the space, the queries becomes faster. But shrinking space requires additional time. We can consider creating index on the table. But the indexes will slow down the inserts.
I wanted to know, how do we handle such tables containing data which has volitile nature.
The database version is 10.2.0.5 and platform Windows server 2008.
Regards,Thanks Justin,
We can't truncate the table.
Basically, the application is for a credit card payment gateway. A credit card transaction may be a successful or unsuccessful transaction. All the data is pushed in flat file. The application loads the data(using SQL loader) in a temporary table and if the merchant_id is correct then the data is pushed in permanent table(say T1). The table T1 may contain successful as well as unsuccessful transations (The unsuccessful transactions have to be maintained for 30 days because of business compulsions). Once the validation is done, the successful transations are moved to different table and are deleted from T1.
Here I have referred T1 as a table having volatile data. We can't truncate it as it has still data which is required by business.
Hope I am clear.
Regards, -
How to handle tables data in XML schema based adobe form
Hi all,
I am working on the CRM business partner creation by using Interactive adobe form with following steps:
1) Uploaded the offline Interactive adobe form to online interactive adobe form via WebDynpro ABAP;
2) Capture XML data into corresponding BAPI structures;
3) Save all the changes to database via BAPI.
The adobe form contains customer information as well as several table views which are bind with the context created in WebDynpro: Node NEW_BP_NODE cardinality 1:1 with single attributes and table type attributes (1:n): COLOUR_COMP, MEN_COMP etc.
While converting the xml format data to SAP context format, It is fine to use following routine to find the single attribute and map to the BAPI structure to do the database update.
NODE = DOCUMENT->FIND_FROM_NAME( NAME = 'XYZu2019).
XYZ = NODE->GET_VALUE( ).
Question: how to convert the xml table data to SAP context format in WebDynpro ABAP?
The XML table data looks like below.
<?xml version="1.0" encoding="UTF-8" ?>
<NEW_BP_NODE>
<COLOUR_COMP>
<DATA>
<ZZTFLD0W2AQW />
<ZZTFLDRZ2AQX>000</ZZTFLDRZ2AQX>
<ZZTFLDVD2TQW />
<ZZTFLDQK2HQX />
<ZZTFLDEL2XQX />
<ZZTFLDTC2DQX>000</ZZTFLDTC2DQX>
<ZZTFLDOR2UQX />
</DATA>
<DATA>
<ZZTFLD0W2AQW />
<ZZTFLDRZ2AQX />
<ZZTFLDVD2TQW />
<ZZTFLDQK2HQX />
<ZZTFLDEL2XQX />
<ZZTFLDTC2DQX />
<ZZTFLDOR2UQX />
</DATA>
<DATA>
<ZZTFLD0W2AQW />
<ZZTFLDRZ2AQX />
<ZZTFLDVD2TQW />
<ZZTFLDQK2HQX />
<ZZTFLDEL2XQX />
<ZZTFLDTC2DQX />
<ZZTFLDOR2UQX />
</DATA>
</COLOUR_COMP>
<MEN_COMP>
<DATA>
<ZZTFLD4V2V7V />
<ZZTFLDYD2N7W>000</ZZTFLDYD2N7W>
<ZZTFLDX32I7W />
<ZZTFLD2D2W7W />
<ZZTFLDGD2A7W />
</DATA>
<DATA>
<ZZTFLD4V2V7V />
<ZZTFLDYD2N7W>000</ZZTFLDYD2N7W>
<ZZTFLDX32I7W />
<ZZTFLD2D2W7W />
<ZZTFLDGD2A7W />
</DATA>
</MEN_COMP>
Thanks in advance for your help.
MichelleHi,
Just follow these steps:
1. Create interactive form UI element in your view.
2. Now provide Datasource and PDFSOURCE to it in form properties.
3. Now give a template name prefix with 'Z' or 'Y'.
4. Double click on it. It will prompt for interface name.
5. Provide interface name prefixed with 'Z' or 'Y'.
6. Click on Context button in the Pop up window and provide the node you have selected as DATASOURCE.
7. Click ok and it will open the form designer.
8. In this way you can create a XML Schema based Form.
9. Activate the interface and design the form providing layout type and other details.
Hope it will help.
Regards,
Vaibhav -
In BDC'S how to handle Table control
Hi,
I want to know the concept and code for BDC's in Table control steps(MM01,VA01) and coding.Please its very Urgent.Hi Raghavendra,
Go through this program mm01.
rePORT ymmbdcmm01
NO STANDARD PAGE HEADING LINE-SIZE 255.
*& Table Declarations *
TABLES:rmmg1,makt,mara,mvke, marc,mbew,t100.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
*& Data Declarations *
DATA:
BEGIN OF t_data OCCURS 0,
data TYPE string,
END OF t_data.
DATA:BEGIN OF it_mess OCCURS 0,
msgtyp(5),
lms(200),
msgv1(50),
END OF it_mess.
DATA: BEGIN OF it_itab OCCURS 0,
matnr TYPE rmmg1-matnr,
mbrsh TYPE rmmg1-mbrsh,
mtart TYPE rmmg1-mtart,
werks TYPE rmmg1-werks,
lgort TYPE rmmg1-lgort,
vkorg TYPE rmmg1-vkorg,
vtweg TYPE rmmg1-vtweg,
maktx TYPE makt-maktx,
meins TYPE mara-meins,
matkl TYPE mara-matkl,
spart TYPE mara-spart,
GEWEI TYPE MARA-GEWEI,
dwerk TYPE mvke-dwerk,
versg TYPE mvke-versg,
mtpos TYPE mvke-mtpos,
mtvfp TYPE marc-mtvfp,
tragr TYPE mara-tragr,
ladgr TYPE marc-ladgr,
sernp TYPE marc-sernp,
txline(25), "added
kordb ,
mprof TYPE mara-mprof,
ekgrp TYPE marc-ekgrp,
dismm TYPE marc-dismm,
dispo TYPE marc-dispo,
disls TYPE marc-disls,
mabst(13) TYPE c,
beskz TYPE marc-beskz,
sobsl TYPE marc-sobsl,
lgpro TYPE marc-lgpro,
dzeit TYPE c,
plifz(3) TYPE c,
webaz TYPE c,
fhori TYPE marc-fhori,
eisbe TYPE c,
strgr(2) TYPE c,
vrmod TYPE c,
vint1(3),
vint2(3),
wzeit(3),
sbdkz TYPE marc-sbdkz,
bklas TYPE mbew-bklas,
vprsv TYPE mbew-vprsv,
verpr(11),
peinh TYPE c,
ekalr TYPE mbew-ekalr,
losgr TYPE c,
RGEKZ(1),
fevor(3),
END OF it_itab.
*decl of internal table of table control for BDCDATA & BDCMSGCOLL
DATA : BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
DATA:it_msgtab TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE,
it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
DATA : fld(50) TYPE c,
cnt(2) TYPE n,
l_mstring(150).
START-OF-SELECTION.
*& File uploading from xlsheet to sap *
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = 'C:\Documents and Settings\sapthamm\Desktop\mm02.xls'
TABLES
i_tab_converted_data = it_itab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Splitting the Internal Table *
LOOP AT t_data.
SPLIT t_data-data AT cl_abap_char_utilities=>horizontal_tab INTO
it_itab-matnr
it_itab-mbrsh
it_itab-mtart
it_itab-werks
it_itab-lgort
it_itab-vkorg
it_itab-vtweg
it_itab-maktx
it_itab-meins
it_itab-matkl
it_itab-spart
it_itab-GEWEI
it_itab-dwerk
it_itab-versg
it_itab-mtpos
it_itab-mtvfp
it_itab-tragr
it_itab-ladgr
it_itab-sernp
it_itab-mprof
it_itab-ekgrp
it_itab-dismm
it_itab-dispo
it_itab-disls
it_itab-mabst
it_itab-beskz
it_itab-sobsl
it_itab-lgpro
it_itab-dzeit
it_itab-plifz
it_itab-webaz
it_itab-fhori
it_itab-eisbe
it_itab-strgr
it_itab-vrmod
it_itab-vint1
it_itab-vint2
it_itab-wzeit
it_itab-sbdkz
it_itab-bklas
it_itab-vprsv
it_itab-peinh
it_itab-ekalr
it_itab-losgr
APPEND it_itab.
CLEAR: it_itab,
t_data-data.
ENDLOOP.
*perform open_dataset using dataset.
*perform open_group.
*do.
*read dataset dataset into it_itab.
*if sy-subrc <> 0. exit. endif.
*& it_itabing of Material Type-HALB *
LOOP AT it_itab.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
it_itab-matnr.
PERFORM bdc_field USING 'RMMG1-MBRSH'
it_itab-mbrsh.
PERFORM bdc_field USING 'RMMG1-MTART'
it_itab-mtart.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(04)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(05)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(06)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(08)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(09)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(12)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(13)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(14)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(15)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(17)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(09)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(06)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(07)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(08)'
'X'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(09)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
it_itab-werks.
PERFORM bdc_field USING 'RMMG1-LGORT'
it_itab-lgort.
PERFORM bdc_field USING 'RMMG1-VKORG'
it_itab-vkorg.
PERFORM bdc_field USING 'RMMG1-VTWEG'
it_itab-vtweg.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-SPART'.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARA-MATKL'
it_itab-matkl.
PERFORM bdc_field USING 'MARA-SPART'
it_itab-spart.
PERFORM bdc_field USING 'MARA-GEWEI'
'kg'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARA-SPART'
it_itab-spart.
PERFORM bdc_field USING 'MVKE-DWERK'
it_itab-dwerk.
PERFORM bdc_field USING 'MARA-MATKL'
it_itab-matkl.
PERFORM bdc_field USING 'MVKE-SKTOF'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MG03STEUER-TAXKM(02)'.
PERFORM bdc_field USING 'MG03STEUER-TAXKM(01)'
'0'.
PERFORM bdc_field USING 'MG03STEUER-TAXKM(02)'
'1'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'MAKT-MAKTX'
it_itab-MAKTX_040.
*perform bdc_field using 'BDC_CURSOR'
'MG03STEUER-TAXKM(05)'.
PERFORM bdc_field USING 'MG03STEUER-TAXKM(03)'
'1'.
PERFORM bdc_field USING 'MG03STEUER-TAXKM(04)'
'1'.
PERFORM bdc_field USING 'MG03STEUER-TAXKM(05)'
'0'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARA-SPART'
it_itab-spart.
PERFORM bdc_field USING 'MVKE-DWERK'
it_itab-dwerk.
PERFORM bdc_field USING 'MARA-MATKL'
it_itab-matkl.
PERFORM bdc_field USING 'MVKE-SKTOF'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'BDC_CURSOR'
'MVKE-MTPOS'.
PERFORM bdc_field USING 'MVKE-VERSG'
it_itab-versg.
PERFORM bdc_field USING 'MVKE-MTPOS'
it_itab-mtpos.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARA-GEWEI'
'KG'.
PERFORM bdc_field USING 'MARC-MTVFP'
it_itab-mtvfp.
PERFORM bdc_field USING 'MARA-TRAGR'
it_itab-tragr.
PERFORM bdc_field USING 'MARC-LADGR'
it_itab-ladgr.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-SERNP'.
PERFORM bdc_field USING 'MARC-SERNP'
it_itab-sernp.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=LTEX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TXVB'.
PERFORM bdc_field USING 'RSTXT-TXLINE(02)'
'pcb assembly'.
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TXBA'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SP09'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARC-EKGRP'
it_itab-ekgrp.
PERFORM bdc_field USING 'MARA-MATKL'
it_itab-matkl.
PERFORM bdc_field USING 'MARC-KORDB'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-MPROF'.
PERFORM bdc_field USING 'MARA-MPROF'
it_itab-mprof.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARC-EKGRP'
it_itab-ekgrp.
PERFORM bdc_field USING 'MARC-DISMM'
it_itab-dismm.
PERFORM bdc_field USING 'MARC-DISPO'
it_itab-dispo.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-MABST'.
PERFORM bdc_field USING 'MARC-DISLS'
it_itab-disls.
PERFORM bdc_field USING 'MARC-MABST'
it_itab-mabst.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARC-BESKZ'
it_itab-beskz.
PERFORM bdc_field USING 'MARC-SOBSL'
it_itab-sobsl.
PERFORM bdc_field USING 'MARC-LGPRO'
it_itab-lgpro.
if it_itab-sernp = 'TJSL'.
PERFORM bdc_field USING 'MARC-RGEKZ'
ELSE.
PERFORM bdc_field USING 'MARC-RGEKZ'
'1'.
ENDIF.
PERFORM bdc_field USING 'MARC-DZEIT'
it_itab-dzeit.
PERFORM bdc_field USING 'MARC-PLIFZ'
it_itab-plifz.
PERFORM bdc_field USING 'MARC-WEBAZ'
it_itab-webaz.
PERFORM bdc_field USING 'MARC-FHORI'
it_itab-fhori.
PERFORM bdc_field USING 'MARC-EISBE'
it_itab-eisbe.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARC-PERKZ'
'M'.
PERFORM bdc_field USING 'MARC-STRGR'
it_itab-strgr.
PERFORM bdc_field USING 'MARC-VRMOD'
it_itab-vrmod.
PERFORM bdc_field USING 'MARC-VINT1'
it_itab-vint1.
PERFORM bdc_field USING 'MARC-VINT2'
it_itab-vint2.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-WZEIT'.
PERFORM bdc_field USING 'MARC-MTVFP'
it_itab-mtvfp.
PERFORM bdc_field USING 'MARC-WZEIT'
it_itab-wzeit.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-SBDKZ'.
PERFORM bdc_field USING 'MARC-SBDKZ'
it_itab-sbdkz.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARC-FEVOR'
'001'.
PERFORM bdc_field USING 'MARC-LGPRO'
it_itab-lgpro.
PERFORM bdc_field USING 'MARC-SERNP'
it_itab-sernp.
PERFORM bdc_field USING 'MARC-DZEIT'
it_itab-dzeit.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
*perform bdc_field using 'MARA-IPRKZ'
it_itab-IPRKZ.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-GEWEI'
'KG'.
PERFORM bdc_field USING 'MARC-SERNP'
it_itab-sernp.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MARA-SPART'
it_itab-spart.
PERFORM bdc_field USING 'BDC_CURSOR'
'MBEW-VPRSV'.
PERFORM bdc_field USING 'MBEW-BKLAS'
it_itab-bklas.
*perform bdc_field using 'MBEW-EKLAS'
it_itab-EKLAS.
PERFORM bdc_field USING 'MBEW-VPRSV'
'v'.
PERFORM bdc_field USING 'MBEW-PEINH'
'1'.
perform bdc_field using 'MBEW-VERPR'
it_itab-VERPR.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'MARA-MEINS'
it_itab-meins.
PERFORM bdc_field USING 'MBEW-EKALR'
'X'.
PERFORM bdc_field USING 'MARC-AWSLS'
'000001'.
PERFORM bdc_field USING 'MARC-LOSGR'
'1'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
it_itab-maktx.
PERFORM bdc_field USING 'BDC_CURSOR'
'MBEW-ZPLPR'.
*perform bdc_field using 'MBEW-ZPLPR'
'6000'.
PERFORM bdc_field USING 'MBEW-BKLAS'
it_itab-bklas.
PERFORM bdc_field USING 'MBEW-VPRSV'
'V'.
PERFORM bdc_field USING 'MBEW-PEINH'
'1'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'MM01' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO it_msgtab.
CLEAR bdcdata[].
CLEAR it_itab.
PERFORM error.
ENDLOOP.
*& Declaration of Error Handling *
i
it_msgtab1-msgv1 = it_msgtab-msgv1.
it_msgtab1-msgv2 = it_msgtab-msgv2.
it_msgtab1-msgv3 = it_msgtab-msgv3.
APPEND it_msgtab1.
ENDLOOP.
download error message to a file by using function module
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'C:\Documents and Settings\sapthamm\Desktop\error.xls'
filetype = 'ASC'
APPEND = ' '
write_field_separator = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_EOL = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
data_tab = it_mess
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form BDC_DYNPRO
text
-->PROGRAM text
-->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF FVAL <> .
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
form error.
LOOP AT it_msgtab.
IF it_msgtab-msgtyp = 'E'.
SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
AND arbgb = it_msgtab-msgid
AND msgnr = it_msgtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
WRITE: / it_msgtab-msgtyp, l_mstring(150).
ELSE.
WRITE: / it_msgtab.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
LOOP AT it_msgtab.
Rewords some points.
rgds,
P.Naganjana reddy -
How to preserve table selections in bc4j?
In a bc4j table with multiple selection, how do I preserve the selections when I navigate the table back and forth? I see examples, which show do-it-yourself data-bound table but not for bc4j.
I did something similar, but my table was in a template. Here is a snippet of my code:
* handleSelections
* Keeps track of the rows that the user has selected from one
* page to the next.
private static void _handleSelections(
BajaContext bc,
Page page,
PageEvent event)
// Get the TableState from the session (the TableState keeps track
// of the blockSize, and the startIndex)
// the key to get the TableState from the session is the table name
HttpSession sess = bc.getServletRequest().getSession();
TableState tState = (LovTableState) sess.getAttribute(_TABLE_NAME);
if (tState == null)
bc.getErrorLog().logMessage("Table state is null.");
return;
String selName = PageEventFlattenedDataSet.getFlattenedName(_TABLE_NAME,
"selectMode");
String selParam = event.getParameter(selName);
// get the selections for the visible table rows.
Boolean[] selections = tState.getSelections(); // tState has selections which is a Boolean array, the length of the table Data.
if ( (selParam != null) &&
("none".equals(selParam) || "all".equals(selParam)) )
Boolean val = new Boolean("all".equals(selParam));
tState.setAllSelections(val);
else
DataSet tableInputs = new PageEventFlattenedDataSet(event,
_TABLE_NAME);
int sz = tableInputs.getLength();
int startRowIndex = tState.getStartIndex() - 1;
int endRowIndex = sz + startRowIndex;
// loop through the visible table rows.
for (int i=0; i < sz; i++)
// get the DataObject representing all the input elements
// on the current table row.
DataObject row = tableInputs.getItem(i);
// Check if this row was selected
Object value = row.selectValue(null, "selected");
// Record the state of the selection of this row.
Boolean val = ((value == null)
? Boolean.FALSE
: Boolean.TRUE);
tState.setSelections( (startRowIndex + i), val);
return;
}and a snippet of the uit file:
<tableSelection>
<multipleSelection data:selected="." data:selection="selections@tableState@data:rootAttr"/>
</tableSelection>
I'll try to take a closer look at your code to see what you might be doing wrong, but hopefully my code snippet will help.
Maybe you are looking for
-
How to set file opening preference in OS 10.5
I have around 1500 Census files which are JPEGS, and they opened nicely with Preview. Today, I loaded most of iLife (iPhoto, iMovie, iDVD and iWeb). Now, for some reason, every one of those files wants to be opened with Adobe Illustrator which is f
-
64 Bit Installer says it's made for 32 bit and tells me to install 64 bit
I used PC Mover to clone my previous XP laptop so the version of iTunes wasn't really made for the 64-bit OS of my new laptop and hasn't worked since. I try every couple of months to fix the problem before giving up out of pure exhaustion! I download
-
Hello, I have a question. I've got one .mov video and one .mp4, both 3 minutes long. Now I want to burn both of them on one single dvd, with a menu (if possible) so i can choose between them. How can I do this?
-
Hi, I'm curious to know if LR will support my current image collection, which resides on 2 separate external firewire 800 hard drives. I read somewhere that LR 1.0 would still require a library file to be housed in a single location, and that you cou
-
Customizing ESS Business Package using Web Dynpro
Hi Does anyone know how we can customize the ESS Business Package using web dynpro. I tried opening one of its application but since it doesn't carry any .project file, it cannot be opened in the NWDS for customization. Also, if there is any document