Add change Icon in the Table Control tool bar.
Hi Abapers,
I need to add "change" icon in the table control. I added it but when I click on it is not working.
My requirement is that when I run my custom report, all the fields should be shown is in display mode. Then when I click on the "change" icon, all fields should be enabled for change.
I have already referred to the standard progs BCALV_* but it does not have the "change" icon.
plz give me any reference prg or sample code.
Thanks
Nani.
Hi Nani,
Track the function code of change icon in user command. if it is clicked then put a flag eq X.
check that flag in PBO, if it is eq X then screen-input = 1 or vice versa.
try this code:
in PBO:
LOOP AT SCREEN
IF WS_EDIT = 'X'
SCREEN-INPUT = 1
ELSE
SCREEN-INPUT = 0
ENDIF
MODIFY SCREEN
ENDLOOP
Hope it will work fine
Regards
Krishnendu
Similar Messages
-
The crop icon on the full edit tool bar.
The crop icon on the full edit tool bar is missing. It used to be there?
How can I add it back?No, it shares a slot with the recompose tool in PSE 9. Click hold on the icon that's below the type tool and you should see it:
-
How to add a symbol in the table control
Hi Experts,
I have created a Table control and want to insert a Symbol in a column and also want it to be interactive. That means when that symbol is being clicked it should perform some action.
Your help is appreciated. This is a little urgent.
~Sid
"Max points are guarenteed"Hi,
Create a pushbutton in table control by dragging it from tool and place it in table control.And then set the name for that pushbutton.Make that push button field as output only field by check/mark -ing a check box of output field in program tab of screen attributes .Now the icon check box for that field will be active .Mark/check that <b>icon</b> check box as well.Once you done this ,then in Loop endloop of table control in PBO do the code like this.
Process Before Output.
LOOP AT it_t001l INTO x_t001l WITH CONTROL tc CURSOR tc-current_line.
MODULE tc_get_lines.
ENDLOOP.
MODULE tc_get_lines OUTPUT.
IF x_t001l-status = 'X'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_OKAY'
info = 'Completed'
IMPORTING
RESULT = x_t001l-change .
*----- x_t001l-change -
> name of the push button in table control
ELSE.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_MASS_CHANGE'
info = 'Partial'
IMPORTING
RESULT = x_t001l-change .
ENDIF.
g_tc_lines = sy-loopc.
ENDMODULE. "TC_GET_LINES OUTPUT
In top include
DATA:BEGIN OF x_t001l.
INCLUDE STRUCTURE t001l.
DATA:sel,
<b>change(60), "</b> ---> name of push button
END OF x_t001l. -
Dynamic icon in the table control
hi friends ,
I wanna to place a command with the icon changing when the status changed .Pls show me how .Thks .hI jACK
I am trying to get it .
as these text store in the table D021T and able to modify the table where the text can be modified to the ICON from PUSHBUTTON.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
DATA RESULT(60).
LOOP AT SCREEN.
IF screen-name = 'BB'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_GREEN_LIGHT'
TEXT = ' '
INFO = ' '
ADD_STDINF = 'X'
IMPORTING
RESULT = RESULT
EXCEPTIONS
ICON_NOT_FOUND = 1
OUTPUTFIELD_TOO_SHORT = 2
UPDATE D021T SET DTXT = RESULT WHERE PROG = 'ZMTEST_99'.
MODIFY SCREEN.
endif.
ENDLOOP.
ENDMODULE. " STATUS_0100 OUTPUT
still i am trying .
I will come back to you.
Regards
Ramchander Rao.K -
Changing data in the table control during run time of transaction F-28
Dear Experts,
in transaction F-28 of second screen of second column (Field Name: Assignment) currently the data is getting from BSEG table and populating this column of table control, now I have a requirement that the data should be get from the other ZTABLE and populate this column during run time instead of the data from BSEG table, please let me know your suggestions, if you guys feel it will be done using User Exit then please let me know the suitable exit for this.
Best Regards
VenkatHi Venkat,
Use the appropriate sort key in the GL to fill up the assignment field automatically.
U can create ur new sort key through OB16
Regards,
Kiran -
Add columns with custom fields in the table control of MIGO
Hi,
I have to add custom fields in the table control view of item in the MIGO. I have added the fields in the GOITEM structure and i am able to display it in the item details tab. I want the same fields to be visible as columns in the table control view of the items.
I found that TV_GOITEM is the control in SAPLMIGO program referring to the table control of items but it is referring only to the standard fields available in Screen 200.
Please let me know if there is any screen exit or option to add the custom fields in the control TV_GOITEM.
Thanks.Hi,
Thanks for your reply. I have added the custom fields in the item detail. But the customer wants the custom fields in the table view also.
Is there any screen exit available to modify the table control of MIGO?
Thanks. -
To add a custom field in table control in transaction me21n and me22n
Hi Guru's,
I have a requirement to add a field in the table control at the time of creation of PO (ME21N). I enhansed the structure MEPO1211, but it is not appearing in the transaction. What should i do in order to bring that field in table control.
I implemented badis ME_GUI_PO_CUST and ME_PROCESS_PO_CUST by seeing some forum results.But i didnt get how to implement...
Please help me in this regard how to follow the steps and if possible please provide a sample code.
Thanks & Regards,
R.P.Sastryhi,
Suppose in the there are three tabs BADI customer1, BADI customer2 and BADI customer3 at item level.
Say:
On BADI customer1 there are three fields FIELD1, FIELD2 and FIELD3.
On BADI customer2 there are two fields FIELD4 and FIELD5.
On BADI customer3 there are three fields FIELD6, FIELD7 and FIELD8.
Then the fields have to be added to EKPO (or requisite custom table as the need may be) and also fields are also to be added to custom structures.
Create a Structure ZSTRUCTURE1 which will contain the three fields FIELD1, FIELD2 and FIELD3.
Create another Structure ZSTRUCTURE2 which will contain the two fields FIELD4 and FIELD5.
Create another Structure ZSTRUCTURE2 which will contain the three fields FIELD6, FIELD7 and FIELD8.
The Structure STRUCTURE1 has to be passed for tab BADI customer1, the Structure STRUCTURE2 has to be passed for tab BADI customer2 and the Structure STRUCTURE3 has to be passed for tab BADI customer3.
Each custom tab/screen should have its own structure to handle the screen fields, but the screen field data has to be transfered to and from EKPO (or requisite custom table as the need may be) for database update/retrieve.
Hope this helps.
Regards,
Ritesh -
Is it possible to add icons to a field in the table control ?
Dear Gurus,
Greetings..............
Is it possible to add icons to the line item of a field in the table control ?
Thanks in advance
Raj KumarHI
YES IT IS POSSIBLE.
DO THE FOLLOWING
1.DECLARE INCLUDE <ICON>.
2.IN YOUR INTERNAL TABLE DECLARE FIELD ICON
icon(4) TYPE c,
3. POPULATE YOUR INTERNAL TABLE WITH APPROPRIATE ICONS BY SELECTING FROM INCLUDE SPECIFIED ABOVE.
EG:
wa2-icon = '@5C@'.
4.PASS IT TO FIELDCAT
wa_fieldcat-fieldname = 'ICON'.
wa_fieldcat-icon = 'X'. " Displayed as Icon
wa_fieldcat-tabname = ' '.
wa_fieldcat-seltext = 'Status'.
wa_fieldcat-coltext = text-001.
APPEND wa_fieldcat TO it_fieldcat. -
How to remove the "table control" icon in ITS based ESS screen
Hi All,
I have upgraded my external ITS 620 to patch level 28. Earlier we were on patch 04.
Since then I am seeing the table control in my ESS screens (ITS Based),
In some thread i got to know that the table control is totally redefined / modified from patch 22 of ITS.
Is it possible that we can remove / hide the table control from the screens.
I dont want to let the users access the "Table Settings" screen at all....can u plz tell me how to do it
regards,
PKwe could not remove the table control...it seems like we can not remove it as the table control also appears in the r3 screens also..
-
Getting values from the table control to the program
Hi Gurus,
i created a program for sales order creation to transfer order creation and to insert multiple values i defined my own selection screen by inserting table control before that the code executed succesfully but after inserting the table control it is not creating any documents
code before inserting table control:-
REPORT zcl120_sales_n_delivery.
SALES DOCUMENT CREATION
PARAMETERS: p_auart TYPE auart OBLIGATORY.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
PARAMETERS: p_spart TYPE vtweg OBLIGATORY.
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
*ITEM
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
PARAMETERS: p_itcat TYPE pstyv OBLIGATORY.
DATA DECLARATIONS.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
HEADER DATA
header-doc_type = p_auart.
headerx-doc_type = 'X'.
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
item-material = p_matnr.
item-plant = p_plant.
item-target_qty = p_menge.
item-target_qu = 'ST'.
item-item_categ = p_itcat.
APPEND item.
itemx-updateflag = 'I'.
itemx-material = 'X'.
itemx-plant = 'X'.
itemx-target_qty = 'X'.
itemx-target_qu = 'X'.
itemx-item_categ = 'X'.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Call the BAPI
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE / return-message.
WRITE: / 'Error in creating document'.
ELSE.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
DELIVERY ORDER CREATION
*PARAMETERS: p_vbeln LIKE vbak-vbeln.
DATA: BEGIN OF t_vbap OCCURS 0,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
kwmeng LIKE vbap-kwmeng,
matnr LIKE vbap-matnr,
werks LIKE vbap-werks,
END OF t_vbap.
DATA: t_request TYPE STANDARD TABLE OF bapideliciousrequest
WITH HEADER LINE.
DATA: t_created TYPE STANDARD TABLE OF bapideliciouscreateditems
WITH HEADER LINE.
DATA: t_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
SELECT vbeln posnr kwmeng matnr werks
INTO TABLE t_vbap
FROM vbap
WHERE vbeln = v_vbeln
LOOP AT t_vbap.
t_request-document_numb = t_vbap-vbeln.
t_request-document_item = t_vbap-posnr.
t_request-quantity_sales_uom = t_vbap-kwmeng.
t_request-id = 1.
t_request-document_type = 'A'.
t_request-delivery_date = sy-datum.
t_request-material = t_vbap-matnr.
t_request-plant = t_vbap-werks.
t_request-date = sy-datum.
t_request-goods_issue_date = sy-datum.
t_request-goods_issue_time = sy-uzeit.
APPEND t_request.
ENDLOOP.
CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
TABLES
request = t_request
createditems = t_created
return = t_return.
READ TABLE t_return WITH KEY type = 'E'.
IF sy-subrc = 0.
MESSAGE e208(00) WITH 'Delivery creation error'.
ENDIF.
COMMIT WORK.
READ TABLE t_created INDEX 1.
WRITE: / 'Delivery Number : ',
t_created-document_numb.
CREATE TRANSFER ORDER
DATA: w_tanum TYPE ltak-tanum.
CALL FUNCTION 'L_TO_CREATE_DN'
EXPORTING
i_lgnum = '010'
i_vbeln = t_created-document_numb
IMPORTING
e_tanum = w_tanum
EXCEPTIONS
foreign_lock = 1
dn_completed = 2
partial_delivery_forbidden = 3
xfeld_wrong = 4
ldest_wrong = 5
drukz_wrong = 6
dn_wrong = 7
squit_forbidden = 8
no_to_created = 9
teilk_wrong = 10
update_without_commit = 11
no_authority = 12
no_picking_allowed = 13
dn_hu_not_choosable = 14
input_error = 15
OTHERS = 16
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK AND WAIT.
WRITE: / 'Transfer order number',
w_tanum.
Code after inserting table control:-
REPORT zcl120_sales_n_delivery.
SALES DOCUMENT CREATION
DATA: p_auart TYPE auart .
DATA: p_vkorg TYPE vkorg .
DATA: p_vtweg TYPE vtweg .
DATA: p_spart TYPE vtweg .
DATA: p_sold TYPE kunnr .
DATA: p_ship TYPE kunnr .
*ITEM
data:
begin of it_item occurs 0,
p_matnr TYPE matnr,
p_menge TYPE kwmeng,
p_plant TYPE werks_d,
p_itcat TYPE pstyv,
end of it_item.
DATA DECLARATIONS.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
DATA:
W_COUNTER TYPE I,
IT_NUM(6) TYPE C value '000010',
IT_LINE(4) TYPE C value '0001'.
CALL SCREEN 100.
HEADER DATA
header-doc_type = p_auart.
headerx-doc_type = 'X'.
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
loop at it_item.
CLEAR ITEM.
item-material = it_item-p_matnr.
item-plant = it_item-p_plant.
item-target_qty = it_item-p_menge.
item-target_qu = 'ST'.
item-item_categ = it_item-p_itcat.
APPEND item.
W_COUNTER = W_COUNTER + 1.
endloop.
DO W_COUNTER TIMES.
itemx-updateflag = 'I'.
itemx-material = 'X'.
itemx-plant = 'X'.
itemx-target_qty = 'X'.
itemx-target_qu = 'X'.
itemx-item_categ = 'X'.
APPEND itemx.
ENDDO.
Fill schedule lines
LOOP AT IT_ITEM.
CLEAR lt_schedules_in.
lt_schedules_in-itm_number = IT_NUM.
lt_schedules_in-sched_line = IT_LINE.
lt_schedules_in-req_qty = IT_ITEM-p_menge.
APPEND lt_schedules_in.
IT_NUM = IT_NUM + 10.
IT_LINE = IT_LINE + 1.
ENDLOOP.
IT_NUM = '000010'.
IT_LINE = '0001'.
Fill schedule line flags
LOOP AT IT_ITEM.
CLEAR lt_schedules_inx.
lt_schedules_inx-itm_number = IT_NUM.
lt_schedules_inx-sched_line = IT_LINE.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
IT_NUM = IT_NUM + 10.
IT_LINE = IT_LINE + 1.
ENDLOOP.
Call the BAPI
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE / return-message.
WRITE: / 'Error in creating document'.
ELSE.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
DELIVERY ORDER CREATION
*PARAMETERS: p_vbeln LIKE vbak-vbeln.
DATA: BEGIN OF t_vbap OCCURS 0,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
kwmeng LIKE vbap-kwmeng,
matnr LIKE vbap-matnr,
werks LIKE vbap-werks,
END OF t_vbap.
DATA: t_request TYPE STANDARD TABLE OF bapideliciousrequest
WITH HEADER LINE.
DATA: t_created TYPE STANDARD TABLE OF bapideliciouscreateditems
WITH HEADER LINE.
DATA: t_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
SELECT vbeln posnr kwmeng matnr werks
INTO TABLE t_vbap
FROM vbap
WHERE vbeln = v_vbeln
LOOP AT t_vbap.
t_request-document_numb = t_vbap-vbeln.
t_request-document_item = t_vbap-posnr.
t_request-quantity_sales_uom = t_vbap-kwmeng.
t_request-id = 1.
t_request-document_type = 'A'.
t_request-delivery_date = sy-datum.
t_request-material = t_vbap-matnr.
t_request-plant = t_vbap-werks.
t_request-date = sy-datum.
t_request-goods_issue_date = sy-datum.
t_request-goods_issue_time = sy-uzeit.
APPEND t_request.
ENDLOOP.
CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
TABLES
request = t_request
createditems = t_created
return = t_return.
READ TABLE t_return WITH KEY type = 'E'.
IF sy-subrc = 0.
MESSAGE e208(00) WITH 'Delivery creation error'.
ENDIF.
COMMIT WORK.
READ TABLE t_created INDEX 1.
WRITE: / 'Delivery Number : ',
t_created-document_numb.
CREATE TRANSFER ORDER
DATA: w_tanum TYPE ltak-tanum.
CALL FUNCTION 'L_TO_CREATE_DN'
EXPORTING
i_lgnum = '010'
i_vbeln = t_created-document_numb
IMPORTING
e_tanum = w_tanum
EXCEPTIONS
foreign_lock = 1
dn_completed = 2
partial_delivery_forbidden = 3
xfeld_wrong = 4
ldest_wrong = 5
drukz_wrong = 6
dn_wrong = 7
squit_forbidden = 8
no_to_created = 9
teilk_wrong = 10
update_without_commit = 11
no_authority = 12
no_picking_allowed = 13
dn_hu_not_choosable = 14
input_error = 15
OTHERS = 16
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK AND WAIT.
WRITE: / 'Transfer order number',
w_tanum.
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB_CON1' ITSELF
CONTROLS: TAB_CON1 TYPE TABLEVIEW USING SCREEN 0100.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB_CON1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
MODULE TAB_CON1_CHANGE_TC_ATTR OUTPUT.
DESCRIBE TABLE IT_ITEM LINES TAB_CON1-lines.
ENDMODULE.
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
SET PF-STATUS 'MENU'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
IF SY-UCOMM EQ 'START'.
LEAVE to screen 0 .
ENDIF.
endmodule. " USER_COMMAND_0100 INPUT
*& Module APPEND_IT_ITEM INPUT
text
module APPEND_IT_ITEM input.
APPEND IT_ITEM.
CLEAR IT_ITEM.
endmodule. " APPEND_IT_ITEM INPUT
plz help me where the error isHi,
Do same as suggested by Ramesh. Add one user command button after clicking that do the looping and call new screen.
Ashven. -
How to clear the table control content
Hi All,
I am doing BDC for cost estimate change. In this the transaction KKPB contains table control. So when ever i process with particular cost estimate, i need to fill the table control with the values. Here when i am doing the BDC for change, i need to clear all the contents of the table control then i need to fill with new entries.
So my problems is how to clear the table control entriee?? please help me in this??
Many Thanks,
Raghu.Hi this might help u.
Check the below link.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
THis is example to upload the Bank details of the Vendor which has the TC.
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
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-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Header file:
1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
TC file:
1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
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.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
with regards,
Hema Sundara. -
Status control icon display in table control
Hi,
In the workarea the field of status control icon is showing Red/green/yellow that is ok but when i am modifying the internal table from this work area then text(Red or green something...) is coming insted of status Icon.
So how to modify internal table from this workarea so that i can display icon in my table control's internal table ?Your input is highly appreciated..
Thanx
Prince RajaDATA : c_green(4) TYPE c VALUE '@08@',
c_red(4) TYPE c VALUE '@0A@'.
IF flag = 'X'.
READ TABLE it_output INTO is_output WITH KEY
bukrs = is_final-bukrs
anln1 = is_final-anln1
anln2 = is_final-anln2
BINARY SEARCH.
IF sy-subrc = 0.
is_output-c_icon = c_green.
is_output-leabg_n = is_final-leabg.
is_output-message = it_return-message.
* Modify the output internal table with the changed new values
MODIFY it_output FROM is_output
TRANSPORTING c_icon leabg_n message
WHERE bukrs = is_output-bukrs
AND anln1 = is_output-anln1
AND anln2 = is_output-anln2.
ENDIF.
Regards
Gopi -
How to validate the dates in the table control ?
How to validate the dates in the table control ?
Can I write like this ?
LOOP AT it_tab .
CHAIN.
FIELD : it_tab-strtdat,it_tab-enddat.
module date_validation.
ENDCHAIN.
ENDLOOP.
Module Date_validation.
ranges : vdat type sy-datum.
vdat-sign = 'I'.
VDAT-LOW = it_tab-STRTDAT.
VDAT-HIGH = it_tab-ENDDAT.
VDAT-OPTION = 'BT'.
APPEND VDAT.
WHAT CODE I have to write here to validate ?
and If I write like this How can we know which is the current row being add ?
It loops total internal table ..?
Bye,
Muttu.Hi,
I think there is no need to put chain endchain.
To do validation you have to write module in PAI which does required validations.
Thanks
DARSHAN PATEL -
Copy selected lines in the table control
Hi friends,
I Have a screen 200 in which i have a button COPY and table control.
In my table control i have 6 lines of data.
now my requirement is when i select any lines ie : let us say i ahve selected 1 , 3 , 5 lines of my table control and when i click on the button COPY of that screen. i need those 3 selected lines 1 , 3 , 5 to be copied again in the table control
example :
line 1 selected
line2
line3 selected
line4
line5 selected .
line6
now my table control should be
line1
line2
line3
line4
line5
line6
line1
line3
line5
How can i do that
Regards
Priyanka.I have similar issue...i need help how to accomplish automatic addition on every line. example (see below)
this is how it looks right now
DATE EMPLOYEE DEPT JOB LOT OPER# LX_HRS OP_SETUP LX_TYPE COMPLETE
2/23/2009 M.Paquiao NB 1960 001 10 1.50 14.00 S NO
2/24/2009 1.00 14.00 S NO
2/25/2009 4.50 14.00 S NO
2/27/2009 3.00 14.00 S NO
2/28/2009 1.50 14.00 R YES
3/1/2009 2.00 14.00 R YES
this what I need it to do when I meant automatic addition of each line:
DATE EMPLOYEE DEPT JOB LOT OPER# LX_HRS OP_SETUP LX_TYPE COMPLETE
2/23/2009 M.Paquiao NB 1960 001 10 1.50 14.00 S NO
2/24/2009 2.50 14.00 S NO
2/25/2009 7.00 14.00 S NO
2/27/2009 10.00 14.00 S NO
2/28/2009 11.50 14.00 R YES
3/1/2009 13.50 14.00 R YES
As you can see everything is the same but on column LX_HRS, the first example one is not doing anything addition but on the second example is now doing addition. This additions were done manually, how can I tell crystal to add each line, in the example above, the
first example second example: (addition is involved)
date lx_hrs date lx_hrs
2/23/09 1.50 2/23/09 1.50
2/24/09 1.00 2/24/09 2.50 (sum of : 1.50 + 1.00 was added)
2/25/09 4.50 2/25/09 7.00 (sum of 2.50 (on date 2/24/09 & 4.50 from date 2/25/09 of the first example). -
Modify data in the table control
hello:
i would like to ask a favor , i am working with a table control (it already has the information i need) all the fields all my table control are present in output form only, but i need when the user press a pushbutton to modify a specific data one of the cell of the table control permit to be change.
my output is:
field1 field2 field3 (only output )
if the user press the button 'CHANGE DATA' it will be present as
field1 field2 fiel3(ready to recibe new data ).
but i don´t know how to do it, if somebody knows how to do it
thanks a lot.this will be your's main program
*& Report ZEMP
REPORT ZEMP.
TABLES: ZEMP." Z TABLE
CONTROLS: TAB_CONTROL TYPE TABLEVIEW USING SCREEN 1000.
DATA: IT LIKE ZEMP OCCURS 0 WITH HEADER LINE.
SELECT * FROM ZEMP INTO CORRESPONDING FIELDS OF TABLE IT.
CALL SCREEN 1000.
*& Module STATUS_1000 OUTPUT
text
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1000 OUTPUT
*& Module USER_COMMAND_1000 INPUT
text
MODULE USER_COMMAND_1000 INPUT.
IF SY-UCOMM = 'BACK'.
LEAVE PROGRAM.
endif.
ENDMODULE. " USER_COMMAND_1000 INPUT
*& Module MODIFY INPUT
text
MODULE MODIFY INPUT.
MODIFY IT INDEX TAB_CONTROL-CURRENT_LINE.
MODIFY ZEMP FROM IT.
ENDMODULE. " MODIFY INPUT
and this should be your flow logic
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
LOOP AT IT WITH CONTROL TAB_CONTROL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
LOOP AT IT.
MODULE MODIFY.
ENDLOOP.
Regards
Prakash Varun
Maybe you are looking for
-
can you please tell me what am i missing. i am getting below error. Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following: := . ( @ % ; CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG" AS FUNCTION
-
Portege 3440 - Can't install Windows 2000
Hello friends :) I have problem with installation Windows 2000 on Portege 3440. I was running installation Windows 2000 with FDD USBB (with driver for CD-ROM PCMCIA) and CD-ROM PCMCIA. All was ok to moment when I entered to winnt" on q. During instal
-
Mini has had two forced shutdowns
Mini has had two forced shutdowns in as many weeks. This is where you have the transparent falling curtain on your screen saying that an error has a occurred and the mini needs to be shutdown. On both I sent the error report to Apple and of course do
-
HT1635 where can I get the power adapter for MC207xx/A . It's a 60W "T" connector
where can I get the power adapter for MC207xx/A . It's a 60W "T" connector
-
First question is how can I override the default constructor (or add an exception to it). I have an object like this create or replace type date_object as object (quarter number, year number(4), member procedure set_date(d