Module pool immediate value update
Hi,
I need to populate a value for a field automatically when the user inputs the date of another field.
I am able to achieve this if I press ENTER, so that PBO triggers and I can populate the other field with the required value.
Suggest me a solution so that without pressing ENTER I need to achieve the scenario.
Hi
Please find below code.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR XXXX " first field
DATA :it_dynpread TYPE TABLE OF dynpread,
wa_dynpread TYPE dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
request = 'A'
TABLES
dynpfields = it_dynpread.
READ TABLE it_dynpread INTO wa_dynpread WITH KEY fieldname = 'S_CAT-LOW'.
yyyyyy (2ndd field )= wa_dynpread-fieldvalue .
Similar Messages
-
Module pool - table control - update ztable
hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
pd: sorry for my bad english
this is my code:
TOP:
PROGRAM z_pp_lote_etiquetas MESSAGE-ID zz.
TABLES:zc2p_lote_etique,
zc2p_lider_modul.
DATA: ok_code LIKE sy-ucomm.
DATA save_ok LIKE sy-ucomm.
* internal table
DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
**************Workarea
DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
DATA: sel.
DATA: MARK.
DATA: init.
DATA: col TYPE scxtab_column.
DATA: lines TYPE i.
* Variable Declaration
DATA : flg, "Flag to set the change mode
ln TYPE i. "No. of records
* Table Control Declartion.
CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
**PROCESS BEFORE OUTPUT INCLUDE **
*& Include Z_PP_LOTE_ETIQUETAS_O01
*& Module set_status OUTPUT
* Setting the GUI status
MODULE status_0100 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
ENDMODULE. " set_status OUTPUT screen 100
* MODULE status_0101 OUTPUT
* Setting the GUI status
MODULE status_0101 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
* Data retreving
if init is INITIAL.
select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
zc2p_lider_crtl-lines = ln + 10.
init = 'X'.
endif.
ENDMODULE. "status_0101 OUTPUT
module change_sdyn_conn output.
* you can change the content of current table control line via
* sdyn_conn
READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
endmodule. " FILL_TABLE_CONTROL OUTPUT
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
*ENDIF.
* Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
PROCESS AFTER INPUT INCLUDE.
* MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'LIDM'.
CALL SCREEN 101.
WHEN 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
* MODULE USER_COMMAND_0101 INPUT
MODULE user_command_0101 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SORT'.
DATA: fldname(100),help(100).
READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
SPLIT col-screen-name AT '-' INTO help fldname.
SORT it_zc2p_lider_modul BY (fldname).
WHEN 'CHANGE'.
* Setting the flag to make the table control in editable mode[excluding
* primary key].
flg = 'Y'.
WHEN 'BACK'.
CALL SCREEN 100.
LEAVE SCREEN.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SAVE'.
MODIFY zc2p_lider_modul FROM it_zc2p_lider_modul.
COMMIT WORK.
ENDCASE.
ENDMODULE. "USER_COMMAND_0101 INPUT
* MODULE read_table_control INPUT
MODULE read_table_control INPUT.
* Check input values
IF mark = 'X' AND save_ok = 'DELETE'.
DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
ENDIF.
ENDMODULE. " READ_TABLE_CONTROL INPUT
Screen Flow Logic 100
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Screen Flow Logic 101.
PROCESS BEFORE OUTPUT.
MODULE status_0101.
LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
zc2p_lider_crtl.
* Dynamic screen modifications
MODULE set_screen_fields.
MODULE change_sdyn_conn.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_0101.
LOOP AT it_zc2p_lider_modul.
MODULE read_table_control.
ENDLOOP.
i hope somebody can help for what i missing here thanks>
Sanjeev Kumar wrote:
> Hello Edgar,
>
> Problem seems to be there in the flow logic of 101
>
>
> PROCESS BEFORE OUTPUT.
> MODULE status_0101.
> LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
> zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
> * Dynamic screen modifications
> MODULE set_screen_fields.
> MODULE change_sdyn_conn.
> ENDLOOP.
> *
> PROCESS AFTER INPUT.
> MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.
>
> LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
> MODULE read_table_control.
> ENDLOOP.
>
>
>
> With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
>
> Try these changes and I hope it will work.
>
> Thanks
> Sanjeev
i do the firts advice but the second one i get syntax error :
my code :
PROCESS AFTER INPUT.
LOOP at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0101.
error :
In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP
AT". -
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya -
Unable to update a record using PAI, in Module pool
Hi Experts,
I m unable to update the records in to the table using P A I in module pool, could any one help me out dear.
The prg is as follows:
INCLUDE MZFIRSTPAGETOP . " global Data
TABLES: ZCHP_CUST_INFO.
DATA: CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
COMM like ZCHP_CUST_INFO-ADDRESS.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'FOR1000'.
SET TITLEBAR '1000'.
ENDMODULE. " STATUS_0100 OUTPUT
INCLUDE MZFIRSTPAGEO01 . " PBO-Modules *
INCLUDE MZFIRSTPAGEI01 . " PAI-Modules *
INCLUDE MZFIRSTPAGEF01 . " FORM-Routines *
*& Module USER_COMMAND_1000 INPUT
text
MODULE USER_COMMAND_1000 INPUT.
CASE SY-UCOMM.
WHEN 'SUBMIT'.
Updating the record.
ZCHP_CUST_INFO-REQ_NUM = C_KNUMV.
ZCHP_CUST_INFO-CREATED_BY = CNAME.
ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
ZCHP_CUST_INFO-SHORT_TEXT = DESC.
ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
ZCHP_CUST_INFO-ADDRESS = COMM.
INSERT ZCHP_CUST_INFO.
COMMIT WORK.
WHEN 'RESET'.
CLEAR: CNAME,REQTYP,PRIO_TYPE,
DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
Thanks in advance,
SunilHi Kal chand,
This is the whole prg where the records are not updated. But the ref number is updated.
INCLUDE MZFIRSTPAGETOP . " global Data
TABLES: ZCHP_CUST_INFO.
DATA: OKCODE LIKE SY-UCOMM.
CONSTANTS: LC_NUMBER_RANGE TYPE INRI-NRRANGENR VALUE '01',
LC_COND_OBJECT TYPE INRI-OBJECT VALUE 'KONV'.
DATA: L_IS_REPL_DELIV TYPE XFLAG,
C_KNUMV TYPE I.
DATA: CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
COMM like ZCHP_CUST_INFO-ADDRESS.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'FOR1000'.
SET TITLEBAR '1000'.
ENDMODULE. " STATUS_0100 OUTPUT
INCLUDE MZFIRSTPAGEO01 . " PBO-Modules *
INCLUDE MZFIRSTPAGEI01 . " PAI-Modules *
INCLUDE MZFIRSTPAGEF01 . " FORM-Routines *
*& Module USER_COMMAND_1000 INPUT
text
MODULE USER_COMMAND_1000 INPUT.
CASE SY-UCOMM.
WHEN 'SUBMIT'.
*FOR INCREMENTING THE VALUE.
C_KNUMV = C_KNUMV + 1.
USED FM TO GENERATE NUMBERS.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_number_range
object = lc_cond_object
IMPORTING
number = c_knumv.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Updating the record.
ZCHP_CUST_INFO-REQ_NUM = C_KNUMV.
ZCHP_CUST_INFO-CREATED_BY = CNAME.
ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
ZCHP_CUST_INFO-SHORT_TEXT = DESC.
ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
ZCHP_CUST_INFO-ADDRESS = COMM.
*ENDIF.
INSERT ZCHP_CUST_INFO.
COMMIT WORK.
WHEN 'RESET'.
CLEAR: CNAME,REQTYP,PRIO_TYPE,
DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
regards,
Sunil -
Updating custom table through table control in module pool
Hi
I am entering a data in the module pool screen in a table control . The functionality is that whatever i enter in a row gets updated in a custom table in the database with the same values . My problem is that when i enter some values and press the save button on the module pool screen , the data gets updated on the table but gets invisible from the module pool screen . The user wants the data to be displayed even after it has been saved ..if anyone can help on this ...
thankshi,
Check whether u have activated the report and screen. -
Module pool - for updating Z table
Moderator message: please using a more meaningful subject. I've edited it for you this time.
Hi i have a reuire ment like this.
i want to update Z table, by using report program.report is having selection screen ti select data from Z table and to disply in a screen like SM30, i am displying in table control using screen.and i am updating Z table.
i want to display the selection screen data which ever i have given just above the table control which ever i am displaying now.
can any body help me out pls.
Regards
naiduHi palani thanks for reply.
i tried in this way already but the problem is we dont know how many values user will enter to define, suppose if user may enter 1000 entries in one selection field or beyond that also.
in this case again the problem.
and one more thing suppose i ahve selection screen like this
company code parameter mandatory
sales org. ranges
division ranges
KUNNR ranges
if suppose user entered only mandatory value, and KUNNR we need to display only those two in output, but here in module pool by using screen table if we disable the screen two blank lines will come.
ex
cmpany code 0001
KUNNR from 1000 TO 2000.
expected result for this is
cmpany code 0001
KUNNR from 1000 TO 2000.
i used scren-input for this but ididnt get,
could you please help me in this.
thanks and regards
naidu -
Hello Experts,
I have a module pool where in a table control I have fields like posnr matnr material description and quantity.
In this posnr field I want values like 10 20 upto 200.which has a increment in 10.
I have added this logic but this posnr values are not getting displayed once I press enter.
How can I display all these values from 10 to 200 even after pressing enter.
Thanks and Regrds,
Nikhil.Hi,
Please check if ur logic is getting triggered when enter is pressed.
Then if so, at the end of internal table updation, update the number of table control lines as follows:
DESCRIBE TABLE t_internal_table LINES TC_TABL_CTRL-LINES.
Regards,
Sasi. -
How to pass the field value from module pool program to smartform using submit?
// AT pai of module pool pgm i entered the following: here gv_orderid is my value to be available at smart form(driver pgm) & zmusic_store_smf is the driver program of my smartform.
gv_orderid= wa-itemid./
SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN
WITH p_order = gv_orderid
AND RETURN.
//AT driver pgm(zmusic_store_smf):
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZMUSIC_SMARTFORM1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = lv_form
EXCEPTIONS
no_form = 1
no_function_module = 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.
CALL FUNCTION lv_form
EXPORTING
* iv_orderid = is_purchase_item-zorder_id.
iv_orderid = gv_orderid.
// here i'm trying to call my smartform('ZMUSIC_SMARTFORM1') from this driver pgm but unable to access the value of gv_orderid please help me out with this.Declare the gv_orderid in modulepool program.
And Declare the parameter as import parameter in smartform.
CALL FUNCTION lv_form
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
i_input = gv_orderid
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5 -
How to validate the field values in module pool program?
Hi Guys
I am working with module pool programming.
Here I want to validate the fields like below.
with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled. This can be done by checking all the fields individually.
I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
If it is possible, can anyone help me?You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
CHAIN.
FIELD: <f1>, <f 2>,...
MODULE <mod1>.
FIELD: <g1>, <g 2>,...
MODULE <mod2>.
ENDCHAIN.
all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
ashish -
Update statement is not working. module pool program,why? check this code
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.Hi,
try to use
start-of-selection.
call screen 100.
module pai input.
endmodule
<b>Reward points</b>
Regards -
Hi all,
I am developing one module pool program.There are 2 screens in this object.In the first screen there are four fields.One of the field is order type.In this order type field i one to set FD as default value,so that when this screen comes up then FD will be in order type field.How I can do that?
Waiting for your response.
Thanks in advance.
RajHi,
Try it:
parameters: p_ordertype type ordertype default 'FD'.
Regards,
Chris Gu -
Getting default values in module pool screen
Hi frenz,
I have a requirement like in module pool i am supposed to bring 4 fields from ddic,in which the first two fields should have a default value i.e when the pbo is processed itself the input values should be displayed in first two fields.....can some one help me out to solve the issue.
thanks
prem
Edited by: prem kumar on Jun 19, 2008 1:30 PMsuppose u are using field1 field2 on screen...
then in PBO create a module
module def_val.
inside it write.
field1 = '100'.
field2 = '101'.
here 100 and 101 are the default values that u r going to assign....
that will solve ur issue..
rewrd points if the ans is helpful... -
Default values in module pool screen issue
Hello,
I have 6 input fields in one of my module pool tab-strip. I can able to populate default values in 4 fields, but 2 fields are not showing default value on the screen. I am passing these default value for all 6 fields in PBO module of that screen. My question is, why only these 2 fields are not showing default values on the screen?
Thanks,
ShreeEdgar,
Thanks for the reply, I checked again, the screen fields and variables name is exactly same.
Here is the sample code:
MODULE status_2050 OUTPUT.
gv_id_no_2050 = '200'.
gv_matnr_2050 = '232020191'.
gv_ebeln_2050 = '20019100'.
gv_qty_2050 = 3.
gv_bukrs_2050 = 'JP01'.
gv_comments_2050 = 'my comments here'.
ENDMODULE. -
Module-pool screen field value under POV event
Hi All,
I have one issue...please suggest me solution for this.
In module-pool program i have one screen(1000) which has one field(hrname_1000).
Under this event:
PROCESS ON VALUE-REQUEST.
FIELD hrname_1000 MODULE hrname_1000.
under this module hename_1000 i have used F4IF_INT_TABLE_VALUE_REQUEST to put a search help for field hrname_1000.
after that i am trying to retrive HR related stuff's based on the field on module-pool i.e i am using hrname_1000 in the where condition.
but problem is that im not getting value for hrname_1000 which im giving in the module-pool screen.
thats y my select query is not working.
Where as im getting values for the hrname_1000 under PBO & PAI.
It will look like below.
PROCESS ON VALUE-REQUEST.
FIELD hrname_1000 MODULE hrname_1000.
(under the above module)
SELECT DISTINCT ename plans FROM pa0001 INTO CORRESPONDING FIELDS OF TABLE itab WHERE stell = '50001026'.
LOOP AT itab INTO wa WHERE ename = hrname_1000.
ENDLOOP.
Please suggest
Thanks & regards
AnsumeshIn some of the cases the screen field is present in the screen but not holding the value in the required structure or field.
so here u need to check the option of reading the screen field values explictly..
//once u hit an enter and do the f4 i think the value will be there ...but if u dont hit enter and do an F4 the value cannot hold and i think u r in this case ..
1.Fill the screen field name in the structure dynpread.
DATA: BEGIN OF DYNP_VALUES OCCURS 10.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNP_VALUES.
DYNP_VALUES-FIELDNAME = 'HRNAME_1000'.
APPEND DYNP_VALUES.
* read screen values
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = HELP_REPID "call the repid of ur prog
DYNUMB = HELP_DYNNR "pass the screen number
TABLES
DYNPFIELDS = DYNP_VALUES
EXCEPTIONS
OTHERS = 1.
now dynp_values hold the field name and field value of the screen .
now
SORT DYNP_VALUES BY FIELDNAME.
READ TABLE DYNP_VALUES WITH KEY 'HRNAME_1000' BINARY SEARCH.
IF SY-SUBRC EQ 0.
HELP_XXXX = DYNP_VALUES-FIELDVALUE. "store the value into a variable
TRANSLATE HELP_XXXX TO UPPER CASE.
ENDIF.
Now check the code with the value if its getting populated which once there will make ur select work ..
Vijay.. -
Module pool custom fiel ZTEST doesen't memorize value
hello, i have create a module pool with a custom field ZTEST declared in the TOP include. The same name i have declared in the Dympro '0100'. In the after input i tried to get the value but the variable ZTEST doesen't contains value also if i have filled in the dympro; infact when i press "enter button" the value is not saved in the CHAIN ENCHAIN.
Why?
Please help me
MarcoPlease check if there is any FIELD statement with the new field in the screen flow logic, viz.,
FIELD ZTEST
the system transfers the values of the screen fields to the program fields only after the FIELD statement
Maybe you are looking for
-
Need help installing camera raw plug-in for Photoshop CS6
I have a Raw photo that won't open in my Photoshop CS6. The error message and online documentation say the same thing...They recommend going under Help > Updates and following the instructions. Problem is, "Updates" is not actually a choice under the
-
My 3Gs won't start anymore, how can I get it to?
I plugged in my 3Gs for the night last week and I woke up with the battery at 80%, so I just thought that maybe it came unplugged or something. I plugged in my charger and nothing happened, I got the "Charging is not supported with this accessory" e
-
Suggestion: add a link to the forum
Some people ask question here in the community page for SQLA, I would like to suggest to provide them a simple access to the SQLA Forum, so that a one stop for questions and answers exists.
-
Relatiive Path problem when using JSP:include in web portlet
Hi I am using Oracle Portal 9.0.2, and thus OC4J as the J2EE platform. I have created a JSP web portlet that is supposed to inlude a specific static html file, which name is passed to it using a portlet parameter. It works, but I had to create a symb
-
I have had horrible results with my titles created in FCP and exported to DVDPRO. They are pixilated. I was using Quicktime export. What I want are the crisp images I used to get on my PC with my Matrox realtimne export card. I recently tried compres