Table control ,BDCMSGCOLL help
hi guys can u plz gimme a simple code along with a small description related to table control &BDCMSGCOLL & plzzzzzzzzzzzzz tell me exactly waat is happening in d code
HI Crandall ,
Check out the following documentation and sample code example
Update Source List by Material Group - MM01
The SCREEN SEQUENCE FOLLOWS
4.6x.
Update Source List by Material Group
Blocking / Unblocking the Vendor
The Vendor code is retrieve from the Purchasing Info Record
REPORT ZSOURCE.
TABLES: EORD,
EINA,
MARC.
Batch Input Name
PARAMETERS P-BTCHSN(12) DEFAULT 'ME01'.
Vendor Code
PARAMETERS P-LIFNR LIKE LFA1-LIFNR DEFAULT 'XXXXX'.
Material Group
PARAMETERS P-MATKL LIKE MARA-MATKL DEFAULT 'XXXXXXX'.
Plants
PARAMETERS P-WERKS LIKE EORD-WERKS DEFAULT 'XX'.
Tick Block/Untick Unblock
PARAMETERS P-NOTKZ LIKE EORD-NOTKZ DEFAULT 'X'.
Auto / Manual run the Batch Input Program
PARAMETERS P-RUN AS CHECKBOX DEFAULT 'X'.
INTERNAL TABLE FOR DATA
DATA: BEGIN OF ULTAB OCCURS 50,
MATNR LIKE EORD-MATNR, "Material No.
WERKS LIKE EORD-WERKS, "Plants
ZEORD LIKE EORD-ZEORD, "NO
LIFNR LIKE EINA-LIFNR, "Vendor Code
END OF ULTAB.
INTERNAL TABLE FOR BATCH INPUT DATA
DATA: BEGIN OF IPUTTAB OCCURS 50.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF IPUTTAB.
INTERNAL TABLE FOR BATCH INPUT ERROR MESSAGE.
DATA: BEGIN OF MESSTAB OCCURS 50.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
DATA: C_TAXKM LIKE MG03STEUER-TAXKM VALUE '1',
W-LINE-NO TYPE I.
REFRESH ULTAB.
SELECT * FROM EINA WHERE LIFNR = P-LIFNR
AND LOEKZ = SPACE.
SELECT SINGLE * FROM MARC WHERE MATNR = EINA-MATNR
AND WERKS = P-WERKS.
CHECK MARC-LVORM = SPACE.
CLEAR ULTAB.
SELECT * FROM EORD WHERE MATNR = EINA-MATNR
AND WERKS = P-WERKS
AND LIFNR = P-LIFNR.
ULTAB-MATNR = EORD-MATNR.
ULTAB-WERKS = EORD-WERKS.
ULTAB-ZEORD = EORD-ZEORD.
ULTAB-LIFNR = EORD-LIFNR.
APPEND ULTAB.
ENDSELECT.
IF SY-SUBRC = 4.
ULTAB-MATNR = EINA-MATNR.
ULTAB-WERKS = P-WERKS.
ULTAB-ZEORD = ''.
ULTAB-LIFNR = EINA-LIFNR.
APPEND ULTAB.
ENDIF.
ENDSELECT.
CHECK WHETHER TABLE IS EMPTY
IF ULTAB[] is initial.
WRITE: / 'TABLE EMPTY'.
ENDIF.
Create Batch session
PERFORM CRE-BATCH-SESS.
LOOP TABLE TO CREATE SCREEN INPUT
SORT.
LOOP AT ULTAB.
REFRESH IPUTTAB.
PERFORM SCREEN1.
PERFORM SCREEN2.
PERFORM PRN_ULTAB.
PERFORM CLOSE-SESS.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
END OF MAIN PROGRAM
FORM SCREEN1.
SCREEN #1: INITAL SCREEN FOR MAINTAINING SOURCE LIST
CLEAR IPUTTAB.
IPUTTAB-PROGRAM = 'SAPLMEOR'.
IPUTTAB-DYNPRO = '200'.
IPUTTAB-DYNBEGIN = 'X'.
APPEND IPUTTAB.
Source List : Material No.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-MATNR'.
IPUTTAB-FVAL = ULTAB-MATNR.
APPEND IPUTTAB.
Source List : Plants.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-WERKS'.
IPUTTAB-FVAL = ULTAB-WERKS.
APPEND IPUTTAB.
ENDFORM.
FORM : SCREEN1 *
FORM SCREEN2.
Modify screen for SOURCE LIST
CLEAR IPUTTAB.
IPUTTAB-PROGRAM = 'SAPLMEOR'.
IPUTTAB-DYNPRO = '205'.
IPUTTAB-DYNBEGIN = 'X'.
APPEND IPUTTAB.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-VDATU(1)'.
IPUTTAB-FVAL = '01.01.2001'.
APPEND IPUTTAB.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-BDATU(1)'.
IPUTTAB-FVAL = '31.12.9999'.
APPEND IPUTTAB.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-LIFNR(1)'.
IPUTTAB-FVAL = P-LIFNR.
APPEND IPUTTAB.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-EKORG(1)'.
IPUTTAB-FVAL = 'ALL'.
APPEND IPUTTAB.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-NOTKZ(1)'.
IPUTTAB-FVAL = P-NOTKZ.
APPEND IPUTTAB.
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'EORD-AUTET(1)'.
IPUTTAB-FVAL = '1'.
APPEND IPUTTAB.
Specify that we are now done with this screen (Save it with F11)
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'BDC_OKCODE'.
IPUTTAB-FVAL = '/11'.
APPEND IPUTTAB.
ENDFORM.
FORM : CLOSE-SESS *
DESCRIPTION : CLOSE THE SESSION *
FORM CLOSE-SESS.
closing the session.
IF P-RUN = 'X'.
Auto run the Batch Input Program
CALL TRANSACTION 'ME01'
USING IPUTTAB
MODE 'E'
UPDATE 'S'
MESSAGES INTO MESSTAB.
ELSE.
Maual run the Batch Input Program
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'ME01'
TABLES
DYNPROTAB = IPUTTAB.
ENDIF.
ENDFORM.
FORM : PRN-ULTAB *
DESCRIPTION : PRINT OK TABLE *
FORM PRN_ULTAB.
WRITE: / ULTAB-MATNR, ULTAB-WERKS, ULTAB-ZEORD, ULTAB-LIFNR.
W-LINE-NO = W-LINE-NO + 1.
WRITE: ' RECORD# ', W-LINE-NO.
ENDFORM.
FORM : CRE-BATCH-SESS *
DESCRIPTION : CREATE BATCH SESSION *
FORM CRE-BATCH-SESS.
Create BTCI session **
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = P-BTCHSN
USER = SY-UNAME
KEEP = 'X'.
ENDFORM.
Good Luck and thanks
AK
Similar Messages
-
How To delete the Chosen line from the Table Control
Hi Friends,
i am new to Module Pool Programming , i developed a Table Control in input mode and i am getting data also into that table control. my requirement is that i want to delete the current chosen line from that table control. please help me out.HI
GOOD
GO THROUGH THIS REPORT
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: cols LIKE LINE OF flights-cols,
lines TYPE i.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
DESCRIBE TABLE itab LINES lines.
flights-lines = lines.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols
WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
ENDCASE.
ENDMODULE.
CHANGE THE CODE AS PER THIS LIGIC.
THANKS
MRUTYUN -
Creation of sale order using bapi in webdynpro using table control
only first row is getting updated when checked in va03, the line items are not getting replaced, only first row is committed..
Here is the code for table control i used...
http://www.scribd.com/doc/51879492/creation-of-sale-order-using-bapi-in-webdynpro-using-table-control
pls help me out with this..Duplicate Posting. Original is here: Sales order creation with bapi in webdynpro using table control
-
Dear Friends!
How are you,
I am having one doubt to ask. I have developed one table control application, With the help of table control I am changing the record of table, and saves it to the internal table this what i am supposed to do.
what I am doing is:
I have fiil the table control from the internal table like this way:
name -
number
abc 23423
efg 56456
jgf 64564
now i want to change the number column and save it again to internal table this way:
name -
number <- on save event or ok_code = save.
abc 22222
efg 55555
jgf 66666
i have dont this flow logic programing.
process before output.
*&spwizard: pbo flow logic for tablecontrol 'MY_TAB'
module my_tab_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
loop at it_item
into wa_item
with control my_tab
cursor my_tab-current_line.
module my_tab_get_lines.
*&spwizard: module MY_TAB_change_field_attr
endloop.
module status_0100.
module set_curson.
module get_date.
module ok_code.
process after input.
*&spwizard: pai flow logic for tablecontrol 'MY_TAB'
loop at it_item.
chain.
field wa_item-item_no.
field wa_item-material_code.
field wa_item-description.
field wa_item-unit_of_measure.
field wa_item-quantity.
field wa_item-rflag.
module my_tab_modify on chain-request.
endchain.
endloop.
module my_tab_user_command.
*&spwizard: module MY_TAB_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
module user_command_0100.
module get_vendor_name.
module move_data_from_table. <----- here i m copying the data from table control to internal table.
process on value-request.
field mseg-mblnr module get_mat_doc.
module move_data_from_table input. <---PAI code.
to move the data from the table control to internal table.
it_item-name = my_tab-name.
it_item-number = my_tab-number.
append it_name.
clear it_name.
endmodule. " move_data_from_table INPUT
now i m receiving the error.. data object my_tab doesnot have the componet called it_item.
here my_tab is table control name.
apparently my code is not perfect as i dont know how to do processes over Table control please help me to develop such application
Any help would be appreciated.
Regards
NaeemHi,
Your code should be in loop endloop of PAI
MODIFY <internal table> INDEX <table control>-CURRENT_LINE. -
Problem with the date field in Table Control
I have created a table control in my module programming. One of the column in the table control is a date field which is I/O field.
Now if I enter a value in date field column and hit enter the date field is reset. I dont want the field to get reset and accept valid date field.
I have set type of the column as DATS and I havent used any dictionary fields. The column is from the internal table in the program.
Please suggestIn your PAI, in the LOOP AT <itab> did you
- check date validity
- update internal table
* Sample
LOOP AT itab.
FIELD itab-field MODULE checkfield.
MODULE updateitab.
ENDLOOP.
Look also at SAP documentation like [Table Controls|http://help.sap.com/abapdocu/en/ABENTABLE_CONTROL1_ABEXA.htm] or [Table Controls in ABAP Programs|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm]
Regards,
Raymond -
Disable few record in a table control not all records
Hi
I have an internal table of 6 rows with table control .first field char 1 (ws_flag) which I am using for line selection of row in the table control .
I have to disable some rows in a table control (user can not select or deselect it).
I dont want to disable all rows . I just want to disable some rows depending upon the condition .
Loop at screen doesnt seem to be working .
I already tried the below given code . how does Screen-name = column name this will besatisfied in a table control.
Set screen attributes for table control
loop at zzhb6_0100 with control zhb6ctl
cursor zhb6ctl-top_line.
module modify_screen_0100.
endloop.
Then:
module modify_screen_0100 output.
loop at screen.
if screen-name = 'ZZHB6_SAL_PHASE2_S-ZZMERIT_AMT'.
if zzhb6_sal_phase2_s-zzself_funded = 'X' or
zzhb6_sal_phase2_s-zzmed_rec = 'X' or
zzhb6_sal_phase2_s-zztr = 'X'.
screen-input = '0'. "Display
modify screen.
endif.
endif.
if screen-name = 'ZZHB6_SAL_PHASE2_S-ZZMERIT_AMT_SP'.
if zzhb6_sal_phase2_s-zzself_funded = 'X'.
screen-input = '0'. "Display
modify screen.
endif.
endif.
endloop.When using table control, chances are you have some code like this in the screen flow logic of the screen.
PROCESS BEFORE OUTPUT.
* PBO FLOW LOGIC FOR TABLECONTROL 'I_WOODCAPCON'
* MODULE I_WOODCAPCON_CHANGE_TC_ATTR.
* MODULE I_WOODCAPCON_CHANGE_COL_ATTR.
LOOP AT I_WOODCAP
WITH CONTROL I_WOODCAPCON
CURSOR I_WOODCAPCON-CURRENT_LINE.
MODULE I_WOODCAPCON_CHANGE_FIELD_ATTR.
ENDLOOP.
MODULE STATUS_0300.
Notice the MODULE I_WOODCAPCON_CHANGE_FIELD_ATTR. in the above code, this is the module which will allow you to change the attributes of the cell per row. Notice that this MODULE is inside the LOOP statement in the PBO flow logic.
So here is the coding for the module.
module i_woodcapcon_change_field_attr output.
modify i_woodcap index i_woodcapcon-current_line.
loop at screen.
if i_woodcap-level = 'B'
and screen-name = 'I_WOODCAP-PDATE'.
screen-input = '0'.
endif.
modify screen.
endloop.
endmodule.
Notice here that my condition statest that if the LEVEL value for the row is "B", then I want to make the PDATE of the row "not ready for input". 'I_WOODCAP is the name of the internal table associated with the table control.
Help this helps.
Regards,
Rich Heilman -
Hi friends,
Iam doing the LSMW for Source list(ME01) for Materail..
Its a small transaction..Number fields also less compare to other transaction..
Problem is..its completely table control.. how can i give the fields in file format..
How its comming next line for updating in table control.. Any body done the lsmw for table control.please help me..
what kind of precauctions i have to take for that updation in Table control..
regards,
sampathhi,
You can have your own custom programs for LSMW. 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...
~~Guduri -
REGARDING "w/selcolumn" IN table control
hi experts,
i m not able to use "w/selcolumn" in table control.
cud u plz how will i use this to delete the data from database table as per the data showing in the table control.
plz help meHi,
<u>Step 1</u>
In your PAI capture all the seleted rows into an internal table. The following code snippet does that.
recsel -> value you have given for w/selcolumn
gt_student_select -> Internal table having the selected rows for deletion
gt_student
module select_record input.
if recsel = 'X'.
read table gt_student_select with key student_id = gt_student-student_id
if sy-subrc eq 4.
gt_student_select-mandt = gt_student-mandt.
gt_student_select-student_id = gt_student-student_id.
gt_student_select-student_name = gt_student-student_name.
gt_student_select-student_address = gt_student-student_address.
gt_student_select-student_average = gt_student-student_average.
append gt_student_select.
endif.
else.
delete table gt_student_select from gt_student.
endif.
endmodule.
<u>Step 2</u>
Perform deletion using the internal table gt_student_select.
when 'DELETE'.
clear ok_code.
"deletes matching record from database table
DELETE ztrch_stud_kri1 FROM table gt_student_select.
"deletes the record from the itab
loop at gt_student_select.
delete table gt_student from gt_student_select.
endloop.
"sets the number of lines displayed in the table control to the
"number of line in the internal table.
DESCRIBE TABLE gt_student LINES tabctrl-lines.
clear gt_student_select[].
***********************Reward points if found useful***************
Regards,
Kriththika. -
Hi all
i would like to know in table control in which case i should go for
LOOP WITH CONTROL tab_con. and in what case i have to opt
LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
n1 TO n2.
Thanks and Regards
Arun JosephHi,
Check this link for Difference in table control
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm
Reward All Help Full Answers
Regards
Fareedas -
Adding context menu to a table control
Hi,
i have a screen with table control. i have to select a column on the table control and i have to copy the contents on that column and i have to paste them on a
excel sheet.
[for this i have to add a context menu with copy text option.( This is my opinion )].
I dont know how to add that context menu to an ordinary table control. please help on this for copying contents of the field to the clipboard.?
Regards,
Tom..HI,
Check this link,
http://www.henrikfrank.dk/abapexamples/ABAP%20objects%20and%20controls/toolbar_control.htm
Thanks & Regards,
Judith. -
Could you help me about table control .. ?
Dear All,
I've a problem in table Control.
I put table control inside tab control (there are many tab in one screen where one tab has one table control).
The schenario of the program, i wanna use table control to maintain the value from some table.
So certainly it has insert/add, delete function.
As we know to do one function in those e.g. add record button, we need specify some code on that button.
So ..
Once when that button is pressed, we can check what button is being pressed using that code.
And it can run well.
But this is the strange one, if i have schenario like this :
1. I click add record button
I will get the add code through ok_code/SY-UCOMM variable.
2. I scroll down/up the table control.
(THIS IS THE WEIRD), the ok_code/SY-UCOMM variable still keep having add code. So every we scroll down/up, application also will add one record.
Could you help me to make ok_code/SY-UCOMM blank in every time i scroll down/up the table control ??
Or could you help me how to i specify the code for scroll down/up the table control so I can identify when user is scrolling down/up the table control??
I really need your guidance/suggestion how to overcome it .. ?
Many tks for all your attention.
Best regards,
Daniel N.Following is a sample code of handling table control in BDC.
REPORT Y730_BDC5 .
*HANDLING TABLE CONTROL IN BDC
DATA : BEGIN OF IT_DUMMY OCCURS 0,
DUMMY(100) TYPE C,
END OF IT_DUMMY.
DATA : BEGIN OF IT_XK01 OCCURS 0,
LIFNR(10) TYPE C,
BUKRS(4) TYPE C,
EKORG(4) TYPE C,
KTOKK(4) TYPE C,
NAME1(30) TYPE C,
SORTL(10) TYPE C,
LAND1(3) TYPE C,
SPRAS(2) TYPE C,
AKONT(6) TYPE C,
FDGRV(2) TYPE C,
WAERS(3) TYPE C,
END OF IT_XK01,
BEGIN OF IT_BANK OCCURS 0,
BANKS(3) TYPE C,
BANKL(10) TYPE C,
BANKN(10) TYPE C,
KOINH(30) TYPE C,
LIFNR(10) TYPE C,
END OF IT_BANK.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = 'C:\VENDOR.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = IT_DUMMY.
LOOP AT IT_DUMMY.
IF IT_DUMMY-DUMMY+0(2) = '11'.
IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
APPEND IT_XK01.
ELSE.
IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
APPEND IT_BANK.
ENDIF.
ENDLOOP.
LOOP AT IT_XK01.
REFRESH IT_BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-REF_LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
IT_XK01-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
IT_XK01-BUKRS.
perform bdc_field using 'RF02K-EKORG'
IT_XK01-EKORG.
perform bdc_field using 'RF02K-KTOKK'
IT_XK01-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
IT_XK01-NAME1.
perform bdc_field using 'LFA1-SORTL'
IT_XK01-SORTL.
perform bdc_field using 'LFA1-LAND1'
IT_XK01-LAND1.
perform bdc_field using 'LFA1-SPRAS'
IT_XK01-SPRAS.
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-KOINH(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
DATA : FNAM(20) TYPE C,
IDX TYPE C.
MOVE 1 TO IDX.
LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKS.
CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKL.
CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKN.
CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-KOINH.
IDX = IDX + 1.
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'
IT_XK01-AKONT.
perform bdc_field using 'LFB1-FDGRV'
IT_XK01-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'
IT_XK01-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'WYT3-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'XK01' USING IT_BDCDATA
MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_BDCMSGCOLL.
ENDLOOP.
FORM BDC_DYNPRO USING PROG SCR.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROG.
IT_BDCDATA-DYNPRO = SCR.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
points plz (if this information is usefull).
Regard's
Raghunath.S -
Search help (PREM) for personal no. is not coming in ALV grid table control
hi experts,
Search help (PREM) for personal no. is not coming in ALV grid table control.
i have assigned the srch help (prem) to my 'ZFIEXP_PROJALLOC' table for the emp_id.
but in output it is now showing the help.
ls_fcat-fieldname = 'EMPLOYEE CODE'.
ls_fcat-ref_table = 'ZFIEXP_PROJALLOC'.
ls_fcat-ref_field = 'EMP_ID'.
ls_fcat-outputlen = '10'.
ls_fcat-key = 'X'.
ls_fcat-edit = 'X'.
ls_fcat-coltext = 'EMPLOYEE CODE'.
ls_fcat-seltext = 'EMPLOYEE CODE'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
Then i tried to solve it using the PA0002 . ie.,
ls_fcat-fieldname = 'EMPLOYEE CODE'.
ls_fcat-ref_table = 'PA0002'.
ls_fcat-ref_field = 'PERNR'.
ls_fcat-outputlen = '10'.
ls_fcat-key = 'X'.
ls_fcat-edit = 'X'.
ls_fcat-coltext = 'EMPLOYEE CODE'.
ls_fcat-seltext = 'EMPLOYEE CODE'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
with this it is showing the help in employee code, but, when i click on an empl number, it is not added to my table control and allowing me to add the number by typing them.
plz help me.
thanks.Hi
In the layout give layout-sel_mode = 'A'. and
pass 'A' to i_save exporting parameter to method set_table_for_first_display.
The same thing if you are working with function module
reuse_alv_grid_display.
Reward points for useful answer.
Venkat -
Table Control Text fields problem , help plz
Hello Anand , Rich , John & All
I hav problem with Text 3 fields( type c)(either L or R aligned ) , it is not geting updated , otherwise everything else is perfectly fine(scrolling,sorting etc ....) .
Fields giving problem are
1. Status(20) type c
2. Fdat type date
3. Remark(100) type c
All numerical fields are working fine .
<u><b> My yahoo messenger-id is [email protected]</b></u>
<b>Any light on this will be awarded plz .</b>
FLOW LOGIC
PROCESS BEFORE OUTPUT.
MODULE SET_STATUS.
LOOP AT ITAB
WITH CONTROL TCL1
CURSOR TCL1-CURRENT_LINE .
MODULE SET_LINE_COUNT .
ENDLOOP.
PROCESS AFTER INPUT.
MODULE UPD_OK_COD.
MODULE EXIT_COMAND AT EXIT-COMMAND.
MODULE SCROLL_SORT.
LOOP AT ITAB.
MODULE UPDATE_ITAB.
ENDLOOP.
MODULE UPDATE_TABLE.
REPORT ZSD_REP_ORDER_BANK_CHANGE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_ORDBANK,MARA,KONV.
CONTROLS: TCL1 TYPE TABLEVIEW USING SCREEN 0200.
DATA: ITAB LIKE ZSD_TABL_ORDBANK OCCURS 0 WITH HEADER LINE,
WA_ITAB LIKE ZSD_TABL_ORDBANK,
OK_CODE LIKE SY-UCOMM,
SAVE_OK_CODE LIKE SY-UCOMM,
UPD_OK_CODE LIKE SY-UCOMM,
ANSWER TYPE C,
I LIKE SY-LOOPC ,
J LIKE SY-LOOPC,
V_LINES LIKE SY-LOOPC,
LINE_COUNT LIKE SY-LOOPC,
STS TYPE N,
EMGRP LIKE MARA-EXTWG,
QTY LIKE ZSD_TABL_ORDBANK-QTY,
UPRICE LIKE ZSD_TABL_ORDBANK-UPRICE,
TOT LIKE ZSD_TABL_ORDBANK-TOT,
INO LIKE VBAP-POSNR,
COL TYPE CXTAB_COLUMN,
COPIED_ONCE ,
FLDNAME(100),HELP(100).
FIELD-SYMBOLS:
<FS_ITAB> LIKE LINE OF ITAB,
<FS_TCL1> LIKE LINE OF TCL1-COLS.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: S_CCODE FOR ZSD_TABL_ORDBANK-CCODE
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_SORG FOR ZSD_TABL_ORDBANK-SORG
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_DCHAN FOR ZSD_TABL_ORDBANK-DISTCHAN,
S_DIV FOR ZSD_TABL_ORDBANK-DIV,
S_MATNO FOR ZSD_TABL_ORDBANK-MATNO,
S_CUSTNO FOR ZSD_TABL_ORDBANK-CUSTNO ,
S_QTNO FOR ZSD_TABL_ORDBANK-QTNO,
S_QTDAT FOR ZSD_TABL_ORDBANK-QTDAT,
S_QTVDAT FOR ZSD_TABL_ORDBANK-QTVALDAT,
S_SONO FOR ZSD_TABL_ORDBANK-SONO.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT * FROM ZSD_TABL_ORDBANK
INTO TABLE ITAB
WHERE CCODE IN S_CCODE
AND SORG IN S_SORG
AND DISTCHAN IN S_DCHAN
AND DIV IN S_DIV
AND MATNO IN S_MATNO
AND CUSTNO IN S_CUSTNO
AND QTNO IN S_QTNO
AND QTDAT IN S_QTDAT
AND QTVALDAT IN S_QTVDAT
AND SONO IN S_SONO .
IF SY-SUBRC EQ 0.
REFRESH ITAB.
CLEAR COPIED_ONCE.
CALL SCREEN 0200.
ELSE.
MESSAGE E012(ZQOTBANK) .
ENDIF.
*& Module SET_STATUS OUTPUT
* text
MODULE SET_STATUS OUTPUT.
SET PF-STATUS '0200'.
SET TITLEBAR '0200'.
IF COPIED_ONCE IS INITIAL.
SELECT * FROM ZSD_TABL_ORDBANK
INTO TABLE ITAB
WHERE CCODE IN S_CCODE
AND SORG IN S_SORG
AND DISTCHAN IN S_DCHAN
AND DIV IN S_DIV
AND MATNO IN S_MATNO
AND CUSTNO IN S_CUSTNO
AND QTNO IN S_QTNO
AND QTDAT IN S_QTDAT
AND QTVALDAT IN S_QTVDAT
AND SONO IN S_SONO .
IF SY-SUBRC EQ 0.
DESCRIBE TABLE ITAB LINES V_LINES.
TCL1-LINES = V_LINES.
ENDIF.
COPIED_ONCE = 'X'.
REFRESH CONTROL 'TCL1' FROM SCREEN '0200'.
ENDIF.
LOOP AT ITAB.
QTY = ITAB-QTY.
UPRICE = ITAB-UPRICE.
TOT = QTY * UPRICE .
ITAB-TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-CGL_QTY.
UPRICE = ITAB-CGL_UPRICE.
TOT = QTY * UPRICE .
ITAB-CGL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-BHEL_QTY.
UPRICE = ITAB-BHEL_UPRICE.
TOT = QTY * UPRICE .
ITAB-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-ALSTOM_QTY.
UPRICE = ITAB-ALSTOM_UPRICE.
TOT = QTY * UPRICE .
ITAB-ALSTOM_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-SIEMENS_QTY.
UPRICE = ITAB-SIEMENS_UPRICE.
TOT = QTY * UPRICE .
ITAB-SIEMENS_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-TELK_QTY.
UPRICE = ITAB-TELK_UPRICE.
TOT = QTY * UPRICE .
ITAB-TELK_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-OTH_QTY.
UPRICE = ITAB-OTH_UPRICE.
TOT = QTY * UPRICE .
ITAB-OTH_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
MODIFY ITAB.
ENDLOOP.
ENDMODULE. " SET_STATUS OUTPUT
*& Module SET_LINE_COUNT INPUT
* text
MODULE SET_LINE_COUNT OUTPUT.
LINE_COUNT = SY-LOOPC.
ENDMODULE. " SET_LINE_COUNT INPUT
*& Module UPD_OK_CODE INPUT
* text
MODULE UPD_OK_COD INPUT.
IF OK_CODE = 'SAVE'.
UPD_OK_CODE = OK_CODE.
* CLEAR OK_CODE.
ENDIF.
ENDMODULE. " UPD_OK_CODE INPUT
*& Module EXIT_COMAND INPUT
* text
MODULE EXIT_COMAND INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'BACK'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Order Bank Entry'
TEXT_QUESTION = 'Do you want to Go BacK ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE TO SCREEN 0.
ELSE.
ENDIF.
WHEN '%EX'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Order Bank Entry'
TEXT_QUESTION = 'Do you want to Exit ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE TO SCREEN 0.
ELSE.
ENDIF.
ENDCASE.
ENDMODULE. " EXIT_COMAND INPUT
*& Module UPDATE_MOD INPUT
* text
MODULE UPDATE_ITAB INPUT.
MODIFY TABLE ITAB FROM ITAB.
ENDMODULE. " UPDATE_MOD INPUT
*& Module SCROLL INPUT
* text
MODULE SCROLL_SORT INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'P--'.
TCL1-TOP_LINE = 1.
WHEN 'P-'.
TCL1-TOP_LINE = TCL1-TOP_LINE - LINE_COUNT.
IF TCL1-TOP_LINE LE 0.
TCL1-TOP_LINE = 1.
ENDIF.
WHEN 'P+'.
I = TCL1-TOP_LINE + LINE_COUNT.
J = TCL1-LINES - LINE_COUNT + 1.
IF J LE 0.
J = 1.
ENDIF.
IF I LE J.
TCL1-TOP_LINE = I.
ELSE.
TCL1-TOP_LINE = J.
ENDIF.
WHEN 'P++'.
TCL1-TOP_LINE = TCL1-LINES - LINE_COUNT + 1.
IF TCL1-TOP_LINE LE 0.
TCL1-TOP_LINE = 1.
ENDIF.
WHEN 'SORTUP'.
READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
SORT ITAB ASCENDING BY (FLDNAME).
ENDIF.
WHEN 'SORTDN'.
READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
SORT ITAB DESCENDING BY (FLDNAME).
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND INPUT
*& Module TABL_UPD INPUT
* text
MODULE UPDATE_TABLE INPUT.
CASE UPD_OK_CODE.
WHEN 'SAVE'.
UPDATE ZSD_TABL_ORDBANK FROM TABLE ITAB .
IF SY-SUBRC EQ 0.
MESSAGE I002(ZQOTBANK) .
CLEAR UPD_OK_CODE.
ELSE.
MESSAGE E003(ZQOTBANK) .
ENDIF.
ENDCASE.
ENDMODULE. " TABL_UPD INPUT
Thnx
moni<b></b><b></b>
Message was edited by: md monirujjaman
Message was edited by: md monirujjamanHi Moni,
The problem as I had replied in your earlier post is with the MODIFY statement.
MODIFY TABLE ITAB FROM ITAB. This statement will do the modifications based on the table key. When you have character fields as editable, then some problems are to be anticipated. In such a scenario, you must update the internal table based on the <i>index</i>, rather than based on <i>key</i>.
So consider using
MODIFY ITAB FROM ITAB INDEX TCL-CURRENT_LINE.
Where TCL is the name of the Table Control. Also observe the difference in syntax here, don't use the TABLE keyword for the MODIFY statement.
Please try it out and let me know.
Regards,
Anand Mandalika. -
Table control small Issues , Plz help in tracing the problem
Hello John , Rich , Anand & all
My sorting is working fine but thr is small problem
1. user has habit of pressing enter after everything,
after entering the values in editable fields in Table control , it doesnt retain the entered values but if he presses save button immediately after entering values , it saves .
how 2 hold the values after pressing enter button
2. Now with this code , it saves the table control content but doesnt display the latest values immediately on the screen .
3. User doesnt want to press SAVE button , he wants save the Table control content by pressing ENTER button,
What is the OK_CODE value for Enter Button plz ?
Plllllzzzzz help me for god sake ASAP.
<u><b>Everyone whoever make an attempt is going to get 10 pnts.</b></u>
==========================
FLOW Logic
PROCESS BEFORE OUTPUT.
MODULE SET_STATUS.
LOOP AT ITAB
WITH CONTROL TCL1
CURSOR TCL1-CURRENT_LINE .
MODULE SET_LINE_COUNT .
ENDLOOP.
PROCESS AFTER INPUT.
MODULE GET_OK_CODE .
MODULE EXIT_COMAND AT EXIT-COMMAND.
MODULE SCROLL_SORT.
LOOP AT ITAB.
MODULE UPDATE_MOD.
ENDLOOP.
==========================
REPORT ZSD_REP_ORDER_BANK_CHANGE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_ORDBANK,MARA,KONV.
CONTROLS: TCL1 TYPE TABLEVIEW USING SCREEN 0200.
DATA: ITAB LIKE ZSD_TABL_ORDBANK OCCURS 0 WITH HEADER LINE,
WA_ITAB LIKE ZSD_TABL_ORDBANK,
OK_CODE LIKE SY-UCOMM,
SAVE_OK_CODE LIKE SY-UCOMM,
UPD_OK_CODE LIKE SY-UCOMM,
ANSWER TYPE C,
I LIKE SY-LOOPC ,
J LIKE SY-LOOPC,
V_LINES LIKE SY-LOOPC,
LINE_COUNT LIKE SY-LOOPC,
STS TYPE N,
EMGRP LIKE MARA-EXTWG,
QTY LIKE ZSD_TABL_ORDBANK-QTY,
UPRICE LIKE ZSD_TABL_ORDBANK-UPRICE,
TOT LIKE ZSD_TABL_ORDBANK-TOT,
INO LIKE VBAP-POSNR,
COL TYPE CXTAB_COLUMN,
COPIED_ONCE ,
FLDNAME(100),HELP(100).
FIELD-SYMBOLS:
<FS_ITAB> LIKE LINE OF ITAB,
<FS_TCL1> LIKE LINE OF TCL1-COLS.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: S_CCODE FOR ZSD_TABL_ORDBANK-CCODE
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_SORG FOR ZSD_TABL_ORDBANK-SORG
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_DCHAN FOR ZSD_TABL_ORDBANK-DISTCHAN,
S_DIV FOR ZSD_TABL_ORDBANK-DIV,
S_MATNO FOR ZSD_TABL_ORDBANK-MATNO,
S_CUSTNO FOR ZSD_TABL_ORDBANK-CUSTNO ,
S_QTNO FOR ZSD_TABL_ORDBANK-QTNO,
S_QTDAT FOR ZSD_TABL_ORDBANK-QTDAT,
S_QTVDAT FOR ZSD_TABL_ORDBANK-QTVALDAT,
S_SONO FOR ZSD_TABL_ORDBANK-SONO.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT * FROM ZSD_TABL_ORDBANK
INTO TABLE ITAB
WHERE CCODE IN S_CCODE
AND SORG IN S_SORG
AND DISTCHAN IN S_DCHAN
AND DIV IN S_DIV
AND MATNO IN S_MATNO
AND CUSTNO IN S_CUSTNO
AND QTNO IN S_QTNO
AND QTDAT IN S_QTDAT
AND QTVALDAT IN S_QTVDAT
AND SONO IN S_SONO .
IF SY-SUBRC EQ 0.
REFRESH ITAB.
CLEAR COPIED_ONCE.
CALL SCREEN 0200.
ELSE.
MESSAGE E012(ZQOTBANK) .
ENDIF.
*& Module SET_STATUS OUTPUT
text
MODULE SET_STATUS OUTPUT.
SET PF-STATUS '0200'.
SET TITLEBAR '0200'.
IF COPIED_ONCE IS INITIAL.
SELECT * FROM ZSD_TABL_ORDBANK
INTO TABLE ITAB
WHERE CCODE IN S_CCODE
AND SORG IN S_SORG
AND DISTCHAN IN S_DCHAN
AND DIV IN S_DIV
AND MATNO IN S_MATNO
AND CUSTNO IN S_CUSTNO
AND QTNO IN S_QTNO
AND QTDAT IN S_QTDAT
AND QTVALDAT IN S_QTVDAT
AND SONO IN S_SONO .
IF SY-SUBRC EQ 0.
DESCRIBE TABLE ITAB LINES V_LINES.
TCL1-LINES = V_LINES.
ENDIF.
COPIED_ONCE = 'X'.
REFRESH CONTROL 'TCL1' FROM SCREEN '0200'.
ENDIF.
LOOP AT ITAB.
QTY = ITAB-QTY.
UPRICE = ITAB-UPRICE.
TOT = QTY * UPRICE .
ITAB-TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-CGL_QTY.
UPRICE = ITAB-CGL_UPRICE.
TOT = QTY * UPRICE .
ITAB-CGL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-BHEL_QTY.
UPRICE = ITAB-BHEL_UPRICE.
TOT = QTY * UPRICE .
ITAB-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-ALSTOM_QTY.
UPRICE = ITAB-ALSTOM_UPRICE.
TOT = QTY * UPRICE .
ITAB-ALSTOM_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-SIEMENS_QTY.
UPRICE = ITAB-SIEMENS_UPRICE.
TOT = QTY * UPRICE .
ITAB-SIEMENS_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-TELK_QTY.
UPRICE = ITAB-TELK_UPRICE.
TOT = QTY * UPRICE .
ITAB-TELK_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-OTH_QTY.
UPRICE = ITAB-OTH_UPRICE.
TOT = QTY * UPRICE .
ITAB-OTH_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
MODIFY ITAB.
ENDLOOP.
ENDMODULE. " SET_STATUS OUTPUT
*& Module SET_LINE_COUNT INPUT
text
MODULE SET_LINE_COUNT OUTPUT.
LINE_COUNT = SY-LOOPC.
ENDMODULE. " SET_LINE_COUNT INPUT
*& Module GET_OK_CODE INPUT
text
MODULE GET_OK_CODE INPUT.
IF OK_CODE = 'SAVE'.
UPD_OK_CODE = OK_CODE.
ENDIF.
ENDMODULE. " GET_OK_CODE INPUT
*& Module EXIT_COMAND INPUT
text
MODULE EXIT_COMAND INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'BACK'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Order Bank Entry'
TEXT_QUESTION = 'Do you want to Go BacK ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE TO SCREEN 0.
ELSE.
ENDIF.
WHEN '%EX'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Order Bank Entry'
TEXT_QUESTION = 'Do you want to Exit ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE TO SCREEN 0.
ELSE.
ENDIF.
ENDCASE.
ENDMODULE. " EXIT_COMAND INPUT
*& Module SCROLL INPUT
text
MODULE SCROLL_SORT INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'P--'.
TCL1-TOP_LINE = 1.
WHEN 'P-'.
TCL1-TOP_LINE = TCL1-TOP_LINE - LINE_COUNT.
IF TCL1-TOP_LINE LE 0.
TCL1-TOP_LINE = 1.
ENDIF.
WHEN 'P+'.
I = TCL1-TOP_LINE + LINE_COUNT.
J = TCL1-LINES - LINE_COUNT + 1.
IF J LE 0.
J = 1.
ENDIF.
IF I LE J.
TCL1-TOP_LINE = I.
ELSE.
TCL1-TOP_LINE = J.
ENDIF.
WHEN 'P++'.
TCL1-TOP_LINE = TCL1-LINES - LINE_COUNT + 1.
IF TCL1-TOP_LINE LE 0.
TCL1-TOP_LINE = 1.
ENDIF.
WHEN 'SORTUP'.
READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
SORT ITAB ASCENDING BY (FLDNAME).
ENDIF.
WHEN 'SORTDN'.
READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
SORT ITAB DESCENDING BY (FLDNAME).
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND INPUT
*& Module UPDATE_MOD INPUT
text
MODULE UPDATE_MOD INPUT.
CASE UPD_OK_CODE.
WHEN 'SAVE'.
UPDATE ZSD_TABL_ORDBANK FROM ITAB .
STS = SY-SUBRC .
IF STS NE 0.
MESSAGE E003(ZQOTBANK) .
ENDIF.
ENDCASE.
ENDMODULE. " UPDATE_MOD INPUT
Thnx
Moni
Message was edited by: md monirujjamanPROCESS BEFORE OUTPUT.
MODULE SET_STATUS.
LOOP AT ITAB
WITH CONTROL TCL1
CURSOR TCL1-CURRENT_LINE .
MODULE SET_LINE_COUNT .
ENDLOOP.
PROCESS AFTER INPUT.
MODULE GET_OK_CODE .
MODULE EXIT_COMAND AT EXIT-COMMAND.
MODULE SCROLL_SORT.
LOOP AT ITAB.
MODULE UPDATE_ITAB.
ENDLOOP.
MODULE UPDATE_TABLE.
changed modules are ......
*& Module UPDATE_MOD INPUT
text
MODULE UPDATE_ITAB INPUT.
MODIFY TABLE ITAB FROM ITAB.
ENDMODULE. " UPDATE_MOD INPUT
*& Module TABL_UPD INPUT
text
MODULE UPDATE_TABLE INPUT.
CASE UPD_OK_CODE.
WHEN 'SAVE'.
UPDATE ZSD_TABL_ORDBANK FROM TABLE ITAB .
IF SY-SUBRC NE 0.
MESSAGE E003(ZQOTBANK) .
ENDIF.
ENDCASE.
ENDMODULE. " TABL_UPD INPUT
now i m able 2 get the latest edited values from user immediately i press enter button and getting saved by pressing SAVE button but further problems are, i have one dropdown button for status 1 field , and 1 date field are not getting updated .
So further help plz. -
Need help in creating a dropdown box inside a table control
Hi,
I need to display a calender upon click event of a dropdown box placed inside my table control.
Can any body help me out.
Regards,
SrinivasTry this ex
TYPE-POOLS VRM.
VALUES-KEY = 'D'.
VALUES-TEXT = 'Double Crate'.
APPEND VALUES.
VALUES-KEY = 'S'.
VALUES-TEXT = 'Single Crate'.
APPEND VALUES.
VALUES-KEY = 'C'.
VALUES-TEXT = 'Carton Box'.
APPEND VALUES.
VALUES-KEY = 'P'.
VALUES-TEXT = 'Pallet'.
APPEND VALUES.
VALUES-KEY = 'W'.
VALUES-TEXT = 'Wood.Case'.
APPEND VALUES.
VALUES-KEY = 'L'.
VALUES-TEXT = 'Loose'.
APPEND VALUES.
CLEAR VALUES.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'CRTYPE'
VALUES = VALUES[]
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
hope it helps..
Edited by: prabhu p on May 22, 2008 10:55 AM
Maybe you are looking for
-
I want to buy a new camcorder and am considering one by JVC. This one, plus a few others such as Sony use AVCHD. I gather this would be need converting before any editing can be done in imovie?? I cant find a simple answer to this question. It seems
-
Can not migrate EJB from WL 5.1 to WL 6.0
I have followed the procedures for migrating my ejb's from weblogic 5.1 to weblogic 6.0. I am receiving an error when I try to deploy an ejb (java.lang.NoClassDefFoundError). The class it can not find is packagename.ejbnameHome. This class is inside
-
Hash mismatch error when downloading OS X Mountain Lion
I have an updated system for mac pro (bought first week of June 2012). Was trying to download OS X Mountain Lion several times but I keep getting the "can't download app hash mismatch" error notification. Would appreciate helpful tips!
-
My HP 5514 has recently stopped printing in black.
My HP 5514 has recently stopped printing in black. The colors do print. I tried a new black cartridge which did not help. I always use HP cartridges. I have tried all the suggestions on the HP website. These include cleaning the printhead several tim
-
I have made a very simple HTML page in text editor on my mac. I'm trying to view what the page would look like in firefox, but it just brings up the code, rather than the webpage, even though the extension in the address bar says .html.