Module pool prorgam in table control designing
Hi ,
I have created the table control in module pool program.(Screen added in VA01 header level under addition data2)
I have given the option for table control for Single line selection and W/Sel colum .
My requirement is if i enter the data in table cotrol( SO creation) or if data alreday Coming in table cotrol (for So Change mode).Should allow to select the row.if table control doesn't have data for line wise.shouldn't t allow to select the Row selection.
I tried to set the table control line selection mode option with TABLE1-LINE_SEL_MODE = 0 through program.Its not allowing to select any row like with data also not allowing to select and without data also its not allowing to select the data.
How to set the functinality for same.
Its very urgent Requirement.
Regards
DIvakar Reddy K.
Hi Divakar,
In the PBO of the screen, you need to write below code:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.
ENDLOOP.
Please refer to program DEMO_DYNPRO_TABCONT_LOOP_AT.
Similar Messages
-
Module pool to maintiane table ztavble
hi
can anyone send me complete code to refer for maintaining a ztable
following validation are required like
1) sortiing
deletein and addition save etc all as in table maintianece i need to code by module pool becasue in table maintainece sorting coding is not possible...
also validation are
1) whne user enters ship to info name 1 should automatically be populated from kna1 on pressing enter how to acheive this by module pool
2) email verification format should be correct? how to acheive this by module pool
3) sorting on basis of all fields
regards
NishantHi Nishanth,,,
I also developed the same kind of Program for maintaining the Ztable...
Jus create a new GUI Staus...with the required functions....
Refer the below code:
REPORT : Z0BRAP_TAX_EXCEPTION .
TITLE : Tax Exceptions Table
AUTHOR : Swaminathan PJ
DATE : 04/12/2006
DDN NUMBER : SAP-BR-TB0020
TRANSPORT REQUEST NUMBER : D12K912309
REFERENCE :
DESCRIPTION
Program Z0BRAP_TAX_EXCEPTION is an Report program to update the table
ZTBRAP_TAX_EXCPT,here user can Create/Change/Display the table entrie
s and can perform the following functions (Filter,Sort,Summation and
Subtotal).
AMENDMENTS
CHANGES REF DATE PERSON Tran.Req. Number
DESCRIPTION:
Include for Global Declarations *
INCLUDE: znbrap_tax_exception_top. " Include for Global Declarative elements
Include
All the subroutines are include
INCLUDE znbrap_tax_exception. " Include for all Subroutines
START OF SELECTION
START-OF-SELECTION.
Main Subroutine
PERFORM procMain.
End of Selection *
END-OF-SELECTION.
INCLUDE : ZNBRAP_TAX_EXCEPTION_TOP
TITLE : Data Declarations
AUTHOR :
DATE : 04.12.2006
TRANSPORT REQUEST NUMBER : D12K912309
DESCRIPTION
Global Data Declarations for Z0BRAP_TAX_EXCEPTION
AMENDMENTS
CHANGES REF DATE PERSON Tran.Req. Number
DESCRIPTION:
ALV Declarations
TYPE-POOLS: slis.
Types contains the structure of the table
*TYPES : BEGIN OF gy_tax_exception.
INCLUDE STRUCTURE ztbrap_tax_excpt.
mandt TYPE mandt,
zmonat TYPE monat,
zbukrs TYPE bukrs,
zlifnr TYPE lifnr,
zexctype TYPE zebrap_exctype,
zstcd1 TYPE stcd1,
zaugdt_other TYPE budat,
zbelnr TYPE belnr,
zdmbtr TYPE dmbtr,
zwhtinssca TYPE dmbtr,
zuserch TYPE syuname,
zdate_change TYPE datum,
ztime_change TYPE uzeit,
*TYPES: END OF gy_tax_exception.
Tables for the structure defined above
*TYPES : gy_tax_exception_tab TYPE STANDARD TABLE OF gy_tax_exception.
Internal Table
DATA: gt_tax_excpt_tab TYPE STANDARD TABLE OF ztbrap_tax_excpt WITH HEADER LINE, "Global internal table for Tax exceptions data
gt_fieldcat TYPE slis_fieldcat_alv OCCURS 0 WITH HEADER LINE. "Global internal table for fieldcat
*& Include ZNBRAP_TAX_EXCEPTION *
*& Form procMain
text
--> p1 text
<-- p2 text
FORM procMain .
Set PF-Status
perform procInitialize.
Select Tax Exceptions Data
perform procGetTaxExceptionsData.
Display ALV Report with Tax Exceptions Data
perform procDisplayTaxExceptionsData.
ENDFORM. " procMain
FORM initialize *
form procInitialize.
CONSTANTS :
lc_pfstatus TYPE abnkr VALUE 'ZTAX_EXCEPTION'. "Pf Status
Set status
set pf-status lc_pfstatus.
endform. "procInitialize
FORM retrieve_data *
Retrieve data from SAP *
form procGetTaxExceptionsData.
REFRESH: gt_tax_excpt_tab.
select * from ztbrap_tax_excpt
appending corresponding fields of table gt_tax_excpt_tab.
endform. "procGetTaxExceptionsData
Called by REUSE_ALV_GRID_DISPLAY when user interacts. *
In this case, there are a number of buttons / menu options for *
user to select for non-standard functions: *
o Single Display *
o Single Change *
o Single create *
o Single Delete *
--> lv_ucomm *
--> LW_SELFIELD *
form user_command using lv_ucomm like sy-ucomm
lw_selfield type slis_selfield.
Work area
DATA: lw_update_tax_excpt TYPE ztbrap_tax_excpt. " work area for tax exceptions data
DATA: lw_tax_exception TYPE ztbrap_tax_excpt. " work area for tax exceptions data
Variables
DATA: lv_key TYPE abkrs , "key fields
lv_non_key TYPE abkrs, "Non Key Fields
lv_insert TYPE ablnv, "Insert
lv_change TYPE ablnv, "Change
lv_entry TYPE ablnv, "Popup title
lv_display TYPE ablnv, "Display
lv_delete TYPE ablnv, "Delete
lv_mode TYPE ablnv . "Menu options
Constants
CONSTANTS:
lc_new TYPE alind VALUE 'ZNEW', "Fcode for new
lc_update TYPE alind VALUE 'ZBR', "Fcode for change
lc_view TYPE alind VALUE 'ZDISP', "Fcode for display
lc_delete TYPE alind VALUE 'ZDEL ', "Fcode for delete
lc_show_field TYPE abkrs VALUE '00', "Show field
lc_hide_field TYPE abkrs VALUE '02'. "Hide field
Clear Local Work Area
CLEAR :
lw_update_tax_excpt.
Clear Local Variables
CLEAR :
lv_key,
lv_non_key,
lv_mode,
lv_insert,
lv_delete,
lv_change,
lv_display.
Retrieve data for selected line & store it in a temp structure.
READ TABLE gt_tax_excpt_tab index lw_selfield-tabindex .
if sy-subrc is not initial and lv_ucomm <> lc_new and lv_ucomm(6) <> 'DELETE'.
message w123(m&). " Position the cursor on a valid line
exit.
endif.
Moving the contents to workarea
MOVE gt_tax_excpt_tab-zmonat TO lw_update_tax_excpt-zmonat.
MOVE gt_tax_excpt_tab-zbukrs TO lw_update_tax_excpt-zbukrs.
MOVE gt_tax_excpt_tab-zlifnr to lw_update_tax_excpt-zlifnr.
MOVE gt_tax_excpt_tab-zexctype to lw_update_tax_excpt-zexctype.
MOVE gt_tax_excpt_tab-zstcd1 to lw_update_tax_excpt-zstcd1.
MOVE gt_tax_excpt_tab-zaugdt_other to lw_update_tax_excpt-zaugdt_other.
MOVE gt_tax_excpt_tab-zbelnr to lw_update_tax_excpt-zbelnr.
MOVE gt_tax_excpt_tab-zdmbtr to lw_update_tax_excpt-zdmbtr.
MOVE gt_tax_excpt_tab-zwhtinssca to lw_update_tax_excpt-zwhtinssca.
MOVE gt_tax_excpt_tab-zuserch to lw_update_tax_excpt-zuserch.
MOVE gt_tax_excpt_tab-zdate_change to lw_update_tax_excpt-zdate_change.
MOVE gt_tax_excpt_tab-ztime_change to lw_update_tax_excpt-ztime_change.
Move the text for Add,Change,Display
Move text-019 To lv_insert.
Move text-020 To lv_change.
Move text-021 To lv_display.
Move text-023 To lv_delete.
Now see which button / menu option user has selected
case lv_ucomm.
when lc_view. "Display a single entry
lv_mode = lv_display.
lv_key = lc_hide_field. "hide key fields
lv_non_key = lc_hide_field. "hide non key fields
perform procFindKeyFields
using lw_update_tax_excpt lv_mode lv_insert lv_delete
lv_change lv_display lv_key lv_non_key lw_selfield.
when lc_update . "Update a single entry (show non-key fields)
lv_mode = lv_change.
lv_key = lc_hide_field. "hide key fields
lv_non_key = lc_show_field. "show non-key fields
perform procFindKeyFields
using lw_update_tax_excpt lv_mode lv_insert lv_delete
lv_change lv_display lv_key lv_non_key lw_selfield.
when lc_new. "Add a single new entry (show all fields)
lv_mode = lv_insert.
lv_key = lc_show_field.
lv_non_key = lc_show_field.
clear lw_update_tax_excpt. "Empty structure to give new entry.
perform procFindKeyFields
using lw_update_tax_excpt lv_mode lv_insert lv_delete
lv_change lv_display lv_key lv_non_key lw_selfield.
WHEN lc_delete. " Delete current entry
lv_mode = lv_delete.
lv_key = lc_hide_field.
lv_non_key = lc_hide_field.
perform procFindKeyFields
using lw_update_tax_excpt lv_mode lv_insert lv_delete
lv_change lv_display lv_key lv_non_key lw_selfield.
endcase.
endform. "user_command
FORM procFindKeyFields *
--> lw_tax_excpt *
--> lw_update_tax_excpt *
--> lv_ret *
form procFindKeyFields using lw_update_tax_excpt structure ztbrap_tax_excpt
lv_mode
lv_insert
lv_delete
lv_change
lv_display
lv_key
lv_non_key
lw_selfield type slis_selfield.
Work area
DATA:lw_key_table TYPE dfies occurs 0 with header line, "Work area for for key fields
lw_tax_excpt TYPE sval occurs 0 with header line. "Work area for tax exceptions data
Variables
DATA: lv_ret TYPE char1, "Return parameter
lv_title TYPE text60, "Popup title
lv_excpt_type TYPE ZEBRAP_EXCTYPE, "Exception type
lv_entry TYPE ablnv, "Popup text
lv_vendor TYPE lifnr, "Vendor
lv_vendor_no TYPE lifnr, "Vendor
lv_co_code TYPE bukrs, "Company code
lv_comp_code TYPE bukrs, "Company code
lv_answer TYPE aavis. "Return parameter
Constants
CONSTANTS:
lc_ref_tab TYPE ablnv VALUE 'T001', "Reference table
lc_ref_fld TYPE ablnv VALUE 'WAERS', "Reference field
lc_hide_fld TYPE abkrs VALUE '04', "Hide field
lc_client TYPE amert VALUE 'MANDT', "Client
lc_user TYPE amert VALUE 'ZUSERCH', "User
lc_date TYPE amert VALUE 'ZDATE_CHANGE', "Date
lc_time TYPE amert VALUE 'ZTIME_CHANGE', "Time
lc_taxno TYPE amert VALUE 'ZSTCD1', "Tax Number
lc_vendor TYPE amert VALUE 'ZLIFNR', "Vendor
lc_exception_typ TYPE amert VALUE 'ZEXCTYPE', "Exception type
lc_clearing_dt TYPE amert VALUE 'ZAUGDT_OTHER', "Clearing date
lc_period TYPE amert VALUE 'ZMONAT', "Period
lc_co_code TYPE amert VALUE 'ZBUKRS', "Company code
lc_gross_amt TYPE amert VALUE 'ZDMBTR', "Gross amount
lc_excpt_amt TYPE amert VALUE 'ZWHTINSSCA', "Exception amount
lc_period_def TYPE abkrs VALUE '00', "Default value for period
lc_amount_def TYPE amert VALUE '0.00', "Default value for amount
lc_date_def TYPE amert VALUE '00000000', "Default value for date
lc_exctype_mf TYPE abkrs VALUE 'MF', "Exception type value
lc_exctype_gr TYPE abkrs VALUE 'GR', "Exception type value
lc_field_obl TYPE aavis VALUE 'X', "Obligatory
lc_cancel TYPE aavis VALUE 'X', "Obligatory
lc_return TYPE aavis VALUE 'A', "Return parameter
lc_mandatory TYPE aavis VALUE '?', "Mandatory
lc_space TYPE abkrs VALUE ' ', "Space
lc_notsupported TYPE agitt VALUE 1, "Exception for FM
lc_others TYPE agitt VALUE 2, "Exception for FM
lc_error TYPE agitt VALUE 1, "Exception for FM
lc_confirm TYPE agitt VALUE 1, "Exception for FM
lc_text TYPE agitt VALUE 1, "Exception for FM
lc_start_column TYPE abkrs VALUE '50', "Start column
lc_start_row TYPE aavis VALUE '7', "Start column
lc_tabname TYPE amert VALUE 'ZTBRAP_TAX_EXCPT', "Table name,
lc_column TYPE SY-CUCOL VALUE 25, "Start column
lc_row TYPE SY-CUROW VALUE 6. "Start row
Clear Local Work Area
CLEAR :
lw_tax_excpt,
lw_key_table .
Clear Local Variables
CLEAR :
lv_ret,
lv_title,
lv_excpt_type,
lv_vendor,
lv_vendor_no,
lv_co_code,
lv_comp_code,
lv_answer.
Field symbol
field-symbols: <lf_tax_excpt>, "Tax exceptions values
<lf_tax_excpt_value>.
Move the text for entry
Move text-022 To lv_entry.
REFRESH lw_tax_excpt.
lw_tax_excpt-field_obl = lc_field_obl.
lw_tax_excpt-tabname = lc_tabname.
Determine which are key fields in the table. This is necessary to
control which fields are available for display
call function 'GET_KEY_FIELDS_OF_TABLE'
EXPORTING
tabname = lw_tax_excpt-tabname
mandt_needed = lc_field_obl
TABLES
key_fieldtab = lw_key_table
EXCEPTIONS
not_supported = lc_notsupported
others = lc_others.
if sy-subrc is not initial.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
loop at gt_fieldcat.
case gt_fieldcat-fieldname.
Supress fields you don't want to show
when lc_client or lc_user or lc_date or lc_time.
when OTHERS.
READ TABLE lw_key_table with key fieldname = gt_fieldcat-fieldname.
if sy-subrc is initial.
lw_tax_excpt-field_attr = lv_key.
lw_tax_excpt-field_obl = lc_field_obl.
else.
lw_tax_excpt-field_attr = lv_non_key.
lw_tax_excpt-field_obl = lc_space.
endif.
lw_tax_excpt-fieldname = gt_fieldcat-fieldname.
assign component lw_tax_excpt-fieldname of
structure lw_update_tax_excpt to <lf_tax_excpt>.
lw_tax_excpt-value = <lf_tax_excpt>.
lw_tax_excpt-fieldtext = gt_fieldcat-seltext_l.
Remove the condition obligatory
IF lw_tax_excpt-fieldname = lc_taxno.
lw_tax_excpt-field_obl = lc_space.
ENDIF.
append lw_tax_excpt.
endcase.
endloop .
Appending the reference table and field for amount field
if lv_mode = lv_insert.
lw_tax_excpt-tabname = lc_ref_tab.
lw_tax_excpt-fieldname = lc_ref_fld.
lw_tax_excpt-field_attr = lc_hide_fld.
append lw_tax_excpt.
endif.
IF lv_mode NE lv_delete.
Show selected entry
CONCATENATE lv_mode lv_entry INTO lv_title SEPARATED BY space.
do.
call function 'POPUP_GET_VALUES'
EXPORTING
popup_title = lv_title
start_column = lc_start_column
start_row = lc_start_row
IMPORTING
returncode = lv_ret
TABLES
fields = lw_tax_excpt
EXCEPTIONS
error_in_fields = lc_error
others = lc_others.
Exit if Error, Display or Delete
if sy-subrc is not initial or lv_ret = lc_return
or lv_mode = lv_display
or lv_mode = lv_delete..
exit.
endif.
Validate fields involved in ADDING NEW ENTRY
IF lv_mode = lv_insert . "ADD new Entry
Validate the field Period
READ TABLE lw_tax_excpt with key fieldname = lc_period.
IF lw_tax_excpt-value EQ lc_period_def.
PERFORM procWarnuser USING text-001 text-003 .
CONTINUE.
ENDIF.
Validate the field Company code
READ TABLE lw_tax_excpt with key fieldname = lc_co_code.
lv_co_code = lw_tax_excpt-value.
select single bukrs from t001 into lv_comp_code
where bukrs = lv_co_code.
IF sy-subrc is not initial.
PERFORM procWarnuser USING text-001 text-028 .
CONTINUE.
ENDIF.
Validate the field Vendor
READ TABLE lw_tax_excpt with key fieldname = lc_vendor.
lv_vendor = lw_tax_excpt-value.
select single lifnr from lfa1 into lv_vendor_no
where lifnr = lv_vendor.
IF sy-subrc is not initial.
PERFORM procWarnuser USING text-001 text-024 .
CONTINUE.
ENDIF.
Store the value of exception type in a variable
READ TABLE lw_tax_excpt with key fieldname = lc_exception_typ.
lv_excpt_type = lw_tax_excpt-value.
Validate the field Tax number1 other entities
READ TABLE lw_tax_excpt with key fieldname = lc_taxno.
IF lv_excpt_type EQ lc_exctype_mf or lv_excpt_type EQ lc_exctype_gr.
IF lw_tax_excpt-value EQ space.
PERFORM procWarnuser USING text-001 text-002 .
CONTINUE.
ENDIF.
ENDIF.
Validate the field Clearing date
READ TABLE lw_tax_excpt with key fieldname = lc_clearing_dt.
IF lw_tax_excpt-value EQ lc_date_def.
PERFORM procWarnuser USING text-001 text-004.
CONTINUE.
ENDIF.
Validate the field Gross amount
READ TABLE lw_tax_excpt with key fieldname = lc_gross_amt.
condense lw_tax_excpt-value no-gaps.
IF lw_tax_excpt-value EQ lc_amount_def OR
lw_tax_excpt-value EQ space.
PERFORM procWarnuser USING text-001 text-005.
CONTINUE.
ENDIF.
Validate the field Exception amount
READ TABLE lw_tax_excpt with key fieldname = lc_excpt_amt.
condense lw_tax_excpt-value no-gaps.
IF lw_tax_excpt-value EQ lc_amount_def OR
lw_tax_excpt-value EQ space.
PERFORM procWarnuser USING text-001 text-006.
CONTINUE.
ENDIF.
delete lw_tax_excpt index 10.
ENDIF.
all checks successful !!!!
exit.
enddo.
endif.
IF lv_mode EQ lv_delete.
CONCATENATE lv_mode lv_entry INTO lv_title SEPARATED BY space.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = lv_title
text_question = text-025
TEXT_BUTTON_1 = text-026
TEXT_BUTTON_2 = text-027
DISPLAY_CANCEL_BUTTON = lc_space
START_COLUMN = lc_column
START_ROW = lc_row
IMPORTING
ANSWER = lv_answer
EXCEPTIONS
TEXT_NOT_FOUND = lc_text
OTHERS = lc_others
IF sy-subrc is not initial.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
Need to pop-out of the sub if "cancel" was selected
if lv_ret = lc_return or lv_mode = lv_display.
exit.
endif.
copy contents of pop-up back into structure
loop at lw_tax_excpt.
check lw_tax_excpt-value <> lc_mandatory.
assign component lw_tax_excpt-fieldname
of structure lw_update_tax_excpt to <lf_tax_excpt_value>.
<lf_tax_excpt_value> = lw_tax_excpt-value.
endloop.
update the database accordingly.
case lv_mode.
when lv_insert. "Insert
Give other required field values
lw_update_tax_excpt-mandt = sy-mandt. "Client
lw_update_tax_excpt-zuserch = sy-uname. "User
lw_update_tax_excpt-zdate_change = sy-datum. "Date
lw_update_tax_excpt-ztime_change = sy-uzeit. "Time
INSERT into ztbrap_tax_excpt values lw_update_tax_excpt.
message s036(zmbrap).
WHEN lv_change. "Change
Give other required field values
lw_update_tax_excpt-mandt = sy-mandt. "Client
lw_update_tax_excpt-zuserch = sy-uname. "User
lw_update_tax_excpt-zdate_change = sy-datum. "Date
lw_update_tax_excpt-ztime_change = sy-uzeit. "Time
MODIFY ztbrap_tax_excpt FROM lw_update_tax_excpt. "Update record
message s037(zmbrap).
WHEN lv_delete. "Delete
IF lv_answer = lc_confirm.
DELETE FROM ztbrap_tax_excpt WHERE
zmonat = lw_update_tax_excpt-zmonat AND
zbukrs = lw_update_tax_excpt-zbukrs AND
zlifnr = lw_update_tax_excpt-zlifnr AND
zexctype = lw_update_tax_excpt-zexctype AND
zstcd1 = lw_update_tax_excpt-zstcd1 AND
zaugdt_other = lw_update_tax_excpt-zaugdt_other AND
zdmbtr = lw_update_tax_excpt-zdmbtr AND
zwhtinssca = lw_update_tax_excpt-zwhtinssca.
message s038(zmbrap).
ENDIF.
endcase.
Now do refresh ...
if sy-subrc is not initial.
rollback work.
message e033(zmbrap).
else.
perform procGetTaxExceptionsData.
commit work.
perform procGetTaxExceptionsData.
lw_selfield-refresh = lc_field_obl.
lw_selfield-col_stable = lc_field_obl.
lw_selfield-row_stable = lc_field_obl.
endif.
endform. "procFindKeyFields
FORM procDisplayTaxExceptionsData *
Produce ALV report *
form procDisplayTaxExceptionsData.
Variables
DATA: lv_layout TYPE slis_layout_alv, "Layout
lv_dispvariant TYPE disvariant, "For display
lv_events TYPE slis_t_event, "Events
lv_grid_settings TYPE lvc_s_glay, "Grid settings
lv_event TYPE slis_alv_event. "Events
Constants
CONSTANTS:
lc_user_command TYPE slis_formname VALUE 'USER_COMMAND', "User command
lc_pf_status TYPE slis_formname VALUE 'PF_STATUS_SET_SHOW_LIST', "Pf status
lc_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE', "Top of page
lc_tab_name TYPE tabname VALUE 'ZTBRAP_TAX_EXCPT', "Table name
lc_stripes TYPE aavis VALUE 'X', "Stripes
lc_save TYPE aavis VALUE 'A', "Save
lc_repid TYPE sy-repid VALUE sy-repid, "Program name
lc_inconsistent TYPE agitt VALUE 1, "Exception for FM
lc_program TYPE agitt VALUE 2, "Exception for FM
lc_others TYPE agitt VALUE 3. "Exception for FM
Clear Local Variables
CLEAR:
lv_layout,
lv_dispvariant,
lv_events,
lv_grid_settings,
lv_event.
*Set up ALV structures
lv_dispvariant-report = lc_repid.
gv_repid = sy-repid.
lv_dispvariant-username = sy-uname.
*Set alternate stripes for ALV report
lv_layout-zebra = lc_stripes .
lv_grid_settings-coll_top_p = lc_stripes .
*Set up exit structure for top of coverpage
lv_event-name = slis_ev_top_of_coverpage.
lv_event-form = slis_ev_top_of_coverpage.
append lv_event to lv_events.
*Set up exit for top of page
lv_event-name = slis_ev_top_of_page.
lv_event-form = slis_ev_top_of_page.
append lv_event to lv_events.
*Build field catalog for List Viewer
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = lc_repid
i_inclname = lc_repid
i_structure_name = lc_tab_name
CHANGING
ct_fieldcat = gt_fieldcat[]
EXCEPTIONS
inconsistent_interface = lc_inconsistent
program_error = lc_program
others = lc_others.
field controls
PERFORM procBuildFieldcat.
Call ABAP/4 List Viewer
check not gt_fieldcat[] is initial.
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lc_repid
i_callback_user_command = lc_user_command
i_callback_pf_status_set = lc_pf_status
i_callback_top_of_page = lc_top_of_page
is_variant = lv_dispvariant
i_grid_settings = lv_grid_settings
is_layout = lv_layout
it_fieldcat = gt_fieldcat[]
it_events = lv_events
i_save = lc_save " A = All => Standard & User
TABLES
t_outtab = gt_tax_excpt_tab.
endform. "procDisplayTaxExceptionsData
**& Form PF_STATUS_SET_SHOW_LIST
Set modified standard status for list
form pf_status_set_show_list
using lw_excpt_tab TYPE slis_t_extab.
Workarea
DATA : lw_tax_tab TYPE slis_extab. "Type group Slis
Constants
DATA : lc_pfstat TYPE amert VALUE 'ZTAX_EXCEPTION', "Pf status
lc_prog TYPE sy-repid VALUE sy-repid, "Program name
lc_fcode TYPE gui_code VALUE 'SELI'. "Function code
Clear Workarea
CLEAR :lw_tax_tab.
lw_tax_tab-fcode = lc_fcode.
append lw_tax_tab to lw_excpt_tab.
set pf-status lc_pfstat of program lc_prog excluding lw_excpt_tab.
endform. "PF_STATUS_SET_SHOW_LIST
**& Form procBuildFieldcat
text
--> p1 text
<-- p2 text
form procBuildFieldcat .
Constants
CONSTANTS :
lc_co_code TYPE amert VALUE 'ZBUKRS', "Company code
lc_vendor TYPE amert VALUE 'ZLIFNR', "Vendor
lc_docu_no TYPE amert VALUE 'ZBELNR', "Document Number
lc_user TYPE amert VALUE 'ZUSERCH', "User
lc_date TYPE amert VALUE 'ZDATE_CHANGE', "Date
lc_time TYPE amert VALUE 'ZTIME_CHANGE', "Time
lc_taxno TYPE amert VALUE 'ZSTCD1', "Tax Number
lc_exception_typ TYPE amert VALUE 'ZEXCTYPE', "Exception type
lc_clearing_dt TYPE amert VALUE 'ZAUGDT_OTHER', "Clearing date
lc_period TYPE amert VALUE 'ZMONAT', "Period
lc_gross_amt TYPE amert VALUE 'ZDMBTR', "Gross amount
lc_excpt_amt TYPE amert VALUE 'ZWHTINSSCA'. "Exception amount
Set the Fieldtext for the Dictionary fields
LOOP AT gt_fieldcat.
gt_fieldcat-key = space.
CASE gt_fieldcat-fieldname.
WHEN lc_period.
gt_fieldcat-seltext_l = text-007.
MODIFY gt_fieldcat.
WHEN lc_co_code.
gt_fieldcat-seltext_l = text-008.
MODIFY gt_fieldcat.
WHEN lc_vendor.
gt_fieldcat-seltext_l = text-009.
MODIFY gt_fieldcat.
WHEN lc_exception_typ.
gt_fieldcat-seltext_l = text-010.
MODIFY gt_fieldcat.
WHEN lc_taxno.
gt_fieldcat-seltext_l = text-011.
MODIFY gt_fieldcat.
WHEN lc_clearing_dt.
gt_fieldcat-seltext_l = text-012.
MODIFY gt_fieldcat.
WHEN lc_docu_no.
gt_fieldcat-seltext_l = text-013.
MODIFY gt_fieldcat.
WHEN lc_gross_amt.
gt_fieldcat-seltext_l = text-014.
gt_fieldcat-outputlen = 12.
MODIFY gt_fieldcat.
WHEN lc_excpt_amt.
gt_fieldcat-seltext_l = text-015.
MODIFY gt_fieldcat.
WHEN lc_user.
gt_fieldcat-seltext_l = text-016.
MODIFY gt_fieldcat.
WHEN lc_date.
gt_fieldcat-seltext_l = text-017.
MODIFY gt_fieldcat.
WHEN lc_time.
gt_fieldcat-seltext_l = text-018.
MODIFY gt_fieldcat.
ENDCASE.
ENDLOOP.
endform. " procBuildFieldcat
*& Form procWarnuser
Warn User - Give error message
-->P_TEXT text
-->P_TEXT text
-->P_lw_tax_excpt_VALUE text
FORM procWarnuser USING uv_title TYPE itex132
uv_text1 TYPE itex132.
Constants
CONSTANTS :
lc_start_column TYPE SY-CUCOL VALUE 25, "Start column
lc_start_row TYPE SY-CUROW VALUE 15. "Start row -
Table control designed by wizard greys out after pressing enter
Dear Gurus
I have implmeted a badi to show some data on vl02n in a extra tab inside a table control designed using table control wizard. I have caught sy-ucomm event to display corrsponding data on the table control to what I am already sending from pbo of the screen everything is working fine beside just one thing. Initially all the rows of table control stays in editable mode but When I enter some record and hit enter the corresponding record is properly shown along with the record from pbo and enterd on the table control but beside the current row all the rows below it turn grey and I cannot enter any further data. Please help me out.
Anurag
Edited by: Anurag Jain on Sep 17, 2009 12:28 PM
Edited by: Anurag Jain on Sep 17, 2009 12:29 PM
Edited by: Anurag Jain on Sep 17, 2009 12:29 PM
Edited by: Anurag Jain on Sep 17, 2009 12:29 PMSolved. The problem was with the sequence in which code was written for all table control in PBO module. PBO code sequence for table controls should be as per the sequence on screen.
-
MODULE POOLL PROGRAMING WITH TABLE CONTROL
hi all,
in table control update, edit, delete
please give me the solution
in pai
where i can write
module
regards*& Include ZPPCONFI01
*& Module USER_COMMAND_9100 INPUT
text
module USER_COMMAND_9100 input.
CASE OK_CODE.
WHEN 'FCAST'.
*&& CASTING
if sy-uname = 'PTEAM' .
CALL SCREEN 9200.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
*&& INSPECTION
WHEN 'FINSP'.
if sy-uname = 'PTEAM' .
CALL SCREEN 9300.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
WHEN 'FGLAZ'.
if sy-uname = 'PTEAM' .
CALL SCREEN 9400.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
WHEN 'FMOUL'.
if sy-uname = 'PTEAM' .
CALL SCREEN 9500.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
when 'BACK'.
CLEAR : I_TAB, I_TAB1.
REFRESH : I_TAB1.
leave program.
ENDCASE.
endmodule. " USER_COMMAND_9100 INPUT
*& Module USER_COMMAND_9200 INPUT
text
module USER_COMMAND_9200 input.
CASE OK_CODE1.
WHEN 'GO'.
*ROUTINE GETDATA
PERFORM GETDATA.
CLEAR OK_CODE1.
*&& BACK
when 'CANCEL'.
leave program.
WHEN 'BACK'.
CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,AFKO-GSTRP,flag,count,qtyflag.
REFRESH : I_TAB1.
LEAVE TO SCREEN 9100.
*&& SAVE INSERT DATA TO ZPPT_CONFIRM
WHEN 'SAVE'.
data : co type C,
del type c.
LOOP AT I_TAB1.
IF I_TAB1-LMNGA IS NOT INITIAL OR
I_TAB1-LMNGA1 IS NOT INITIAL. "OR
I_TAB1-XMNGA IS NOT INITIAL.
if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'P'.
MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER at Line' sy-tabix.
continue.
endif.
clear : v_charg.
SELECT single CHARG FROM MCHB into v_charg
WHERE LGORT = '1080'
AND LVORM <> 'X'
AND CHARG = I_TAB1-CHARG.
if sy-subrc <> 0.
Message 'Enter correct batch' type 'W'.
continue.
endif.
IF I_TAB1-LMNGA IS NOT INITIAL AND
I_TAB1-CHARG IS INITIAL.
MESSAGE 'Enter Batch' TYPE 'S'.
ELSE.
*&& ACTIVITY 10
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '103'. "MRP CONTROLLER
ZPPT_CONFIRM-VORNR = '0010'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR. "ORDER NO
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH23'. "ORDER TYPE
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ. "MATERIAL
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA. "MOULD FILL
ZPPT_CONFIRM-GRUND = I_TAB1-GRUND. "reason for scrap
ZPPT_CONFIRM-ZSUPNAME = SNAME. "supervioser name
ZPPT_CONFIRM-CHARG = I_TAB1-CHARG. "batch
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED. "PRODUCT SCHEDULER
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
sno = sno + 1.
ZPPT_CONFIRM-sno = sno.
INSERT ZPPT_CONFIRM.
CLEAR ZPPT_CONFIRM.
*&& ACTIVITY 20
if I_TAB1-XMNGA1 <> space.
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '103'.
ZPPT_CONFIRM-VORNR = '0020'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR.
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH23'.
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ.
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-XMNGA = I_TAB1-XMNGA1. "SCARP
if I_TAB1-XMNGA1 is NOT INITIAL.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
ZPPT_CONFIRM-GRUND = '0001'. "reason for scrap
CO = 'X'.
endif.
ZPPT_CONFIRM-ZSUPNAME = SNAME.
ZPPT_CONFIRM-CHARG = I_TAB1-CHARG.
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED.
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
sno = sno + 1.
ZPPT_CONFIRM-sno = sno.
INSERT ZPPT_CONFIRM.
CLEAR ZPPT_CONFIRM.
endif.
if I_TAB1-XMNGA2 <> space.
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '103'.
ZPPT_CONFIRM-VORNR = '0020'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR.
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH23'.
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ.
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
ZPPT_CONFIRM-XMNGA = I_TAB1-XMNGA2. "SCARP
if I_TAB1-XMNGA2 is NOT INITIAL.
ZPPT_CONFIRM-GRUND = '0002'. "reason for scrap
if co <> 'X'.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
co = 'X'.
endif.
endif.
ZPPT_CONFIRM-ZSUPNAME = SNAME.
ZPPT_CONFIRM-CHARG = I_TAB1-CHARG.
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED.
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
sno = sno + 1.
ZPPT_CONFIRM-sno = sno.
INSERT ZPPT_CONFIRM.
CLEAR ZPPT_CONFIRM.
endif.
if I_TAB1-XMNGA3 <> space.
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '103'.
ZPPT_CONFIRM-VORNR = '0020'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR.
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH23'.
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ.
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
ZPPT_CONFIRM-XMNGA = I_TAB1-XMNGA3. "SCARP
if I_TAB1-XMNGA3 is NOT INITIAL.
ZPPT_CONFIRM-GRUND = '0003'. "reason for scrap
if co <> 'X'.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
co = 'X'.
endif.
endif.
ZPPT_CONFIRM-ZSUPNAME = SNAME.
ZPPT_CONFIRM-CHARG = I_TAB1-CHARG.
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED.
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
sno = sno + 1.
ZPPT_CONFIRM-sno = sno.
INSERT ZPPT_CONFIRM.
CLEAR ZPPT_CONFIRM.
endif.
if I_TAB1-XMNGA4 <> space.
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '103'.
ZPPT_CONFIRM-VORNR = '0020'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR.
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH23'.
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ.
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
ZPPT_CONFIRM-XMNGA = I_TAB1-XMNGA4. "SCARP
if I_TAB1-XMNGA4 is NOT INITIAL.
ZPPT_CONFIRM-GRUND = '0004'. "reason for scrap
if co <> 'X'.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA1. "CARRYOUT
co = 'X'.
endif.
endif.
ZPPT_CONFIRM-ZSUPNAME = SNAME.
ZPPT_CONFIRM-CHARG = I_TAB1-CHARG.
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED.
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
sno = sno + 1.
ZPPT_CONFIRM-sno = sno.
INSERT ZPPT_CONFIRM.
CLEAR ZPPT_CONFIRM.
endif.
IF SY-SUBRC = 0.
DELETE TABLE I_TAB1 FROM I_TAB1.
ENDIF.
CLEAR ZPPT_CONFIRM.
ENDIF.
ENDIF.
ENDLOOP.
CLEAR OK_CODE1.
ENDCASE.
endmodule. " USER_COMMAND_9200 INPUT
*& Form GETDATA
text
--> p1 text
<-- p2 text
form GETDATA .
refresh i_tab1.
V_DATE = AFKO-GSTRP.
SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP INTO (V_PRDSCHED, V_ZHODNO)
WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
if sy-subrc = 0.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = V_DATE
IMPORTING
EV_MONTH_BEGIN_DATE = sdate
EV_MONTH_END_DATE = edate.
SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
AND ENDDA = '99991231'.
IF AFKO-PLNBEZ IS NOT INITIAL.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AAUFNR = BAUFNR
JOIN AUFK AS C ON
AAUFNR = CAUFNR
JOIN JEST AS D ON
COBJNR = DOBJNR
WHERE A~FEVOR = V_PRDSCHED
AND A~PLNBEZ = AFKO-PLNBEZ
AND A~DISPO = '103'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH23'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'.
IF SY-SUBRC = 0.
ccontrol-lines = sy-dbcnt.
LOOP AT I_TAB1.
SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
WHERE MATKL = I_TAB1-PLNBEZ+0(7)
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
MODIFY I_TAB1 FROM I_TAB1.
CLEAR I_TAB1.
ENDIF.
ENDLOOP.
ENDIF.
ELSE.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AAUFNR = BAUFNR
JOIN AUFK AS C ON
AAUFNR = CAUFNR
JOIN JEST AS D ON
COBJNR = DOBJNR
WHERE A~FEVOR = V_PRDSCHED
AND A~DISPO = '103'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH23'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'.
IF SY-SUBRC = 0.
ccontrol-lines = sy-dbcnt.
LOOP AT I_TAB1.
SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
WHERE MATKL = I_TAB1-PLNBEZ+0(7)
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
MODIFY I_TAB1 FROM I_TAB1.
CLEAR I_TAB1.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
endif.
sort i_tab1 by plnbez.
endform. " GETDATA
*& Module F4HELPONCHARG INPUT
text
module F4HELPONCHARG input.
CLEAR : V_MATNR, V_STEPL, V_STLNR, V_IDNRK.
CLEAR : C_TOPLINE.
C_TOPLINE = CCONTROL-TOP_LINE - 1.
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
POVSTEPL = v_stepl
EXCEPTIONS
STEPL_NOT_FOUND = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
v_stepl = v_stepl + C_TOPLINE.
READ TABLE I_TAB1 INDEX v_stepl.
IF SY-SUBRC = 0.
SELECT SINGLE STLNR FROM AFKO INTO V_STLNR
WHERE AUFNR = I_TAB1-AUFNR.
IF SY-SUBRC = 0.
V_MATNR = I_TAB1-PLNBEZ+0(7).
CONCATENATE V_MATNR '%' INTO V_MATNR.
SELECT SINGLE IDNRK FROM STPO INTO V_IDNRK
WHERE STLNR = V_STLNR
AND IDNRK LIKE V_MATNR.
IF SY-SUBRC = 0.
SELECT CHARG FROM MCHB INTO TABLE I_BATCH
WHERE MATNR LIKE V_IDNRK
AND LGORT = '1080'
AND WERKS = T001W-WERKS
AND LVORM <> 'X'.
ENDIF.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'I_TAB-CHARG'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'CHARG'
STEPL = 0
WINDOW_TITLE = 'BATCH'
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = I_BATCH
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 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.
ENDIF.
endmodule. " F4HELPONCHARG INPUT
*& Module F4HELPONGRUND INPUT
text
module F4HELPONGRUND input.
SELECT GRUND GRDTX FROM TRUGT
INTO CORRESPONDING FIELDS OF TABLE I_TRUG
WHERE WERKS = T001W-WERKS
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'I_TAB-GRUND'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'GRUND'
STEPL = 1
WINDOW_TITLE = 'Variance'
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = I_TRUG
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 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.
ENDIF.
endmodule. " F4HELPONGRUND INPUT
*& Module MOVE_DATA_TO_INTERNALTAB INPUT
text
module MOVE_DATA_TO_INTERNALTAB input.
CLEAR I_TAB1.
CLEAR ZWERKS_HR.
IF T001W-WERKS = '1102'.
ZWERKS_HR = '1200'.
ENDIF.
if I_TAB-EMPNO <> space and I_TAB-EMPNO+0(1) <> 'P'.
MESSAGE I991(ZMESSAGE) with 'ENTER POTTER NUMBER'.
***BREAK-POINT.
FLAG = 'X'.
COUNT = ( CCONTROL-CURRENT_LINE - CCONTROL-Top_line ) + 1.
continue.
endif.
IF I_TAB-EMPNO IS NOT INITIAL.
SELECT SINGLE ENAME FROM PA0001 INTO I_TAB-ENAME
WHERE PERNR = I_TAB-EMPNO.
SELECT SINGLE A~ENAME
A~PERNR
A~WERKS
B~USRID
INTO CORRESPONDING FIELDS OF TABLE I_FINAL
INTO (I_TAB-ENAME,I_TAB-pernr)
FROM PA0001 AS A
JOIN PA0105 AS B ON APERNR = BPERNR
WHERE B~USRID <> SPACE
AND B~USRID = I_TAB-EMPNO
AND A~endda = '99991231'
AND A~WERKS = ZWERKS_HR
AND ( B~SUBTY = 'POTT' OR
B~SUBTY = 'INSP' OR
B~SUBTY = 'GLAZ' OR
B~SUBTY = 'STOP' OR
B~SUBTY = 'SORT' ).
IF SY-SUBRC <> 0.
clear : I_TAB-ENAME,I_TAB-pernr.
ENDIF.
ENDIF.
MOVE-CORRESPONDING I_TAB TO I_TAB1.
MODIFY I_TAB1 FROM I_TAB1 INDEX CCONTROL-CURRENT_LINE.
endmodule. " MOVE_DATA_TO_INTERNALTAB INPUT
*& Module USER_COMMAND_9300 INPUT
text
module USER_COMMAND_9300 input.
CASE OK_CODE2.
*&& GET DATA FOR INSPECTION
WHEN 'GO'.
PERFORM GETINSDATA.
CLEAR OK_CODE2.
*&& BACK
WHEN 'BACK'.
CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,
AFKO-GSTRP,PA0105-USRID,FLAG,COUNT,COUNT1.
REFRESH : I_TAB1.
LEAVE TO SCREEN 9100.
*&& SAVE INSERT DATA TO ZPPT_CONFIRM
WHEN 'SAVE'.
LOOP AT I_TAB1.
IF I_TAB1-LMNGA IS NOT INITIAL OR
I_TAB1-XMNGA IS NOT INITIAL.
if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'I'.
MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER at Line' sy-tabix.
continue.
endif.
*&& ACTIVITY 10
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '110'. "MRP CONTROLLER
ZPPT_CONFIRM-VORNR = '0010'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR. "ORDER NO
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH24'. "ORDER TYPE
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ. "MATERIAL
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-rcpts = I_TAB1-rcpts.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA. "MOULD FILL
ZPPT_CONFIRM-XMNGA = I_TAB1-XMNGA. "SCRAP
if I_TAB1-XMNGA is NOT INITIAL.
ZPPT_CONFIRM-GRUND = I_TAB1-GRUND. "reason for scrap
endif.
ZPPT_CONFIRM-ZSUPNAME = SNAME. "supervioser name
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED. "PRODUCT SCHEDULER
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
INSERT ZPPT_CONFIRM.
IF SY-SUBRC = 0.
DELETE TABLE I_TAB1 FROM I_TAB1.
ENDIF.
CLEAR ZPPT_CONFIRM.
ENDIF.
ENDLOOP.
CLEAR : OK_CODE2.
ENDCASE.
endmodule. " USER_COMMAND_9300 INPUT
*& Form GETINSDATA
text
--> p1 text
<-- p2 text
form GETINSDATA .
refresh i_tab1.
V_DATE = AFKO-GSTRP.
SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP INTO (V_PRDSCHED, V_ZHODNO)
WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
if sy-subrc = 0.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = V_DATE
IMPORTING
EV_MONTH_BEGIN_DATE = sdate
EV_MONTH_END_DATE = edate.
SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
AND ENDDA = '99991231'.
IF AFKO-PLNBEZ IS NOT INITIAL.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AAUFNR = BAUFNR
JOIN AUFK AS C ON
AAUFNR = CAUFNR
JOIN JEST AS D ON
COBJNR = DOBJNR
WHERE
A~PLNBEZ = AFKO-PLNBEZ
AND A~DISPO = '110'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH24'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'.
IF SY-SUBRC = 0.
icontrol-lines = sy-dbcnt.
LOOP AT I_TAB1.
SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
WHERE MATKL = I_TAB1-PLNBEZ+0(7)
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
MODIFY I_TAB1 FROM I_TAB1.
CLEAR I_TAB1.
ENDIF.
ENDLOOP.
ENDIF.
ELSE.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AAUFNR = BAUFNR
JOIN AUFK AS C ON
AAUFNR = CAUFNR
JOIN JEST AS D ON
COBJNR = DOBJNR
WHERE
A~FEVOR = V_PRDSCHED
A~DISPO = '110'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH24'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'.
IF SY-SUBRC = 0.
icontrol-lines = sy-dbcnt.
LOOP AT I_TAB1.
SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
WHERE MATKL = I_TAB1-PLNBEZ+0(7)
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
MODIFY I_TAB1 FROM I_TAB1.
CLEAR I_TAB1.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
endif.
sort i_tab1 by plnbez.
endform. " GETINSDATA
*& Module USER_COMMAND_9400 INPUT
text
module USER_COMMAND_9400 input.
CASE OK_CODE3.
*&& GET DATA FOR INSPECTION
WHEN 'GO'.
PERFORM GETGLADATA.
CLEAR OK_CODE3.
*&& BACK
WHEN 'BACK'.
CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,
AFKO-GSTRP,PA0105-USRID,flag,count.
REFRESH : I_TAB1.
LEAVE TO SCREEN 9100.
*&& SAVE INSERT DATA TO ZPPT_CONFIRM
WHEN 'SAVE'.
LOOP AT I_TAB1.
IF I_TAB1-LMNGA IS NOT INITIAL OR
I_TAB1-XMNGA IS NOT INITIAL.
if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'G'.
MESSAGE I991(ZMESSAGE) with 'ENTER GLAZER NUMBER at Line' sy-tabix.
continue.
endif.
*&& ACTIVITY 10
ZPPT_CONFIRM-CDATE = SY-DATUM.
ZPPT_CONFIRM-CTIME = SY-UZEIT.
ZPPT_CONFIRM-PDATE = afko-gstrp.
ZPPT_CONFIRM-WERKS = T001W-WERKS.
ZPPT_CONFIRM-DISPO = '104'. "MRP CONTROLLER
ZPPT_CONFIRM-VORNR = '0010'.
ZPPT_CONFIRM-AUFNR = I_TAB1-AUFNR. "ORDER NO
ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
ZPPT_CONFIRM-AUFART = 'ZH24'. "ORDER TYPE
ZPPT_CONFIRM-MATNR = I_TAB1-PLNBEZ. "MATERIAL
ZPPT_CONFIRM-MAKTX = I_TAB1-WGBEZ.
ZPPT_CONFIRM-GAMNG = I_TAB1-GAMNG.
ZPPT_CONFIRM-LMNGA = I_TAB1-LMNGA. "MOULD FILL
ZPPT_CONFIRM-XMNGA = I_TAB1-XMNGA. "SCRAP
if I_TAB1-XMNGA is NOT INITIAL.
ZPPT_CONFIRM-GRUND = I_TAB1-GRUND. "reason for scrap
endif.
ZPPT_CONFIRM-ZSUPNAME = SNAME. "supervioser name
ZPPT_CONFIRM-ZHODNO = V_ZHODNO.
ZPPT_CONFIRM-FEVOR = V_PRDSCHED. "PRODUCT SCHEDULER
ZPPT_CONFIRM-PERNR = I_TAB1-pernr.
ZPPT_CONFIRM-ENAME = I_TAB1-ENAME.
ZPPT_CONFIRM-ZUSER = sy-uname.
INSERT ZPPT_CONFIRM.
IF SY-SUBRC = 0.
DELETE TABLE I_TAB1 FROM I_TAB1.
ENDIF.
CLEAR ZPPT_CONFIRM.
ENDIF.
ENDLOOP.
CLEAR : OK_CODE3.
ENDCASE.
endmodule. " USER_COMMAND_9400 INPUT
*& Form GETGLADATA
text
--> p1 text
<-- p2 text
form GETGLADATA .
refresh i_tab1.
CLEAR : V_MATNR1.
CONCATENATE '%' V_COLOR '%' INTO V_MATNR1.
V_DATE = AFKO-GSTRP.
SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP INTO (V_PRDSCHED, V_ZHODNO)
WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
if sy-subrc = 0.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = V_DATE
IMPORTING
EV_MONTH_BEGIN_DATE = sdate
EV_MONTH_END_DATE = edate.
SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
AND ENDDA = '99991231'.
if ZMATKL <> SPACE and AFKO-PLNBEZ <> SPACE.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AMANDT = BMANDT
AND AAUFNR = BAUFNR
JOIN AUFK AS C ON
AMANDT = CMANDT
AND AAUFNR = CAUFNR
JOIN JEST AS D ON
CMANDT = DMANDT
AND COBJNR = DOBJNR
JOIN MARA AS E ON
AMANDT = EMANDT
AND APLNBEZ = EMATNR
WHERE
A~PLNBEZ = AFKO-PLNBEZ
A~PLNBEZ LIKE V_MATNR1
AND A~DISPO = '104'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH24'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'
AND E~MATKL = ZMATKL.
elseIF ZMATKL <> SPACE and AFKO-PLNBEZ = SPACE.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AMANDT = BMANDT
AND AAUFNR = BAUFNR
JOIN AUFK AS C ON
AMANDT = CMANDT
AND AAUFNR = CAUFNR
JOIN JEST AS D ON
CMANDT = DMANDT
AND COBJNR = DOBJNR
JOIN MARA AS E ON
AMANDT = EMANDT
AND APLNBEZ = EMATNR
WHERE
A~FEVOR = V_PRDSCHED
A~PLNBEZ LIKE V_MATNR1
AND A~DISPO = '104'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH24'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'
AND E~MATKL = ZMATKL.
elseIF ZMATKL = SPACE and AFKO-PLNBEZ <> SPACE.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AMANDT = BMANDT
AND AAUFNR = BAUFNR
JOIN AUFK AS C ON
AMANDT = CMANDT
AND AAUFNR = CAUFNR
JOIN JEST AS D ON
CMANDT = DMANDT
AND COBJNR = DOBJNR
JOIN MARA AS E ON
AMANDT = EMANDT
AND APLNBEZ = EMATNR
WHERE
A~PLNBEZ = AFKO-PLNBEZ
A~PLNBEZ LIKE V_MATNR1
AND A~DISPO = '104'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH24'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'.
AND E~MATKL = ZMATKL.
elseIF ZMATKL = SPACE and AFKO-PLNBEZ = SPACE.
select A~AUFNR
A~PLNBEZ
A~GAMNG
INTO corresponding fields of TABLE I_TAB1
FROM AFKO AS A
JOIN AFPO AS B ON
AMANDT = BMANDT
AND AAUFNR = BAUFNR
JOIN AUFK AS C ON
AMANDT = CMANDT
AND AAUFNR = CAUFNR
JOIN JEST AS D ON
CMANDT = DMANDT
AND COBJNR = DOBJNR
JOIN MARA AS E ON
AMANDT = EMANDT
AND APLNBEZ = EMATNR
WHERE
A~PLNBEZ = AFKO-PLNBEZ
A~PLNBEZ LIKE V_MATNR1
AND A~DISPO = '104'
AND A~GLTRP between sdate and edate
AND B~DAUAT = 'ZH24'
AND B~PWERK = T001W-WERKS
AND D~STAT = 'I0002'
AND D~INACT <> 'X'.
AND E~MATKL = ZMATKL.
endif.
IF SY-SUBRC = 0.
gcontrol-lines = sy-dbcnt.
LOOP AT I_TAB1.
SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
WHERE MATKL = I_TAB1-PLNBEZ+0(7)
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
MODIFY I_TAB1 FROM I_TAB1.
CLEAR I_TAB1.
ENDIF.
ENDLOOP.
ENDIF.
endif.
sort i_tab1 by plnbez.
endform. " GETGLADATA
*& Module MOVE_DATA_TO_INTERNALTAB_INS INPUT
text
module MOVE_DATA_TO_INTERNALTAB_INS input.
CLEAR I_TAB1.
CLEAR ZWERKS_HR.
IF T001W-WERKS = '1102'.
ZWERKS_HR = '1200'.
ENDIF.
if I_TAB-EMPNO <> space and I_TAB-EMPNO+0(1) <> 'I'.
MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER'.
*BREAK-POINT.
FLAG = 'X'.
COUNT = ICONTROL-CURRENT_LINE.
continue.
endif.
IF I_TAB-EMPNO IS NOT INITIAL.
SELECT SINGLE ENAME FROM PA0001 INTO I_TAB-ENAME
WHERE PERNR = I_TAB-EMPNO.
SELECT SINGLE A~ENAME
A~PERNR
A~WERKS
B~USRID
INTO CORRESPONDING FIELDS OF TABLE I_FINAL
INTO (I_TAB-ENAME,I_TAB-pernr)
FROM PA0001 AS A
JOIN PA0105 AS B ON APERNR = BPERNR
WHERE B~USRID <> SPACE
AND B~USRID = I_TAB-EMPNO
AND A~endda = '99991231'
AND A~WERKS = ZWERKS_HR
AND ( B~SUBTY = 'POTT' OR
B~SUBTY = 'INSP' OR
B~SUBTY = 'GLAZ' OR
B~SUBTY = 'STOP' OR
B~SUBTY = 'SORT' ).
IF SY-SUBRC <> 0.
clear : I_TAB-ENAME,I_TAB-pernr.
ENDIF.
ENDIF.
MOVE-CORRESPONDING I_TAB TO I_TAB1.
MODIFY I_TAB1 FROM I_TAB1 INDEX ICONTROL-CURRENT_LINE.
endmodule. " MOVE_DATA_TO_INTERNALTAB_INS INPUT
*& Module MOVE_DATA_TO_INTERNALTAB_GLA INPUT
text
module MOVE_DATA_TO_INTERNALTAB_GLA input.
CLEAR I_TAB1.
CLEAR ZWERKS_HR. -
Using function module DYNP_VALUES_UPDATE to update table control
Hello all
i am using FM "DYNP_VALUES_UPDATE" to update values from search help to dynpro. there are more than 1000 records to be updated, but in table control only visible area values only getting updated. Can any one please help regarding this?
Thanks
NeelimaLook at FM DYNP_GET_STEPL which provides povstepl index to be able to update field values in correct row of table control with DYNP_VALUES_UPDATE (and to read correct value with DYNP_VALUES_READ too)
NB: If you need to update multiple rows, I'm not sure that can be done in POV, you may be required to modify the internal table and trigger PAI/PBO cycle with a suppress dialog, or method/FM to trigger ok_code.
Regards,
Raymond -
How to find modules using a specific table in Designer 10g?
Hi, we are in a conversion traject from Designer 6.0 to Designer 10g with patchset 10.1.2.5.
Apart from a conversion problem for which we got a workaround (see bug number 8453702) it looks ok now.
But with functional testing I found something strange:
- in Des10g, when you look at the usages of a table, you do not see the "Used in Module Components" part anymore. That is pretty annoying. Now I found a way to show something with aid of the matrix diagrammer, but i'm not very happy with it.
My questions:
- How come this has changed? and
- is there another way to quickly view these usages, or are we stuck with this?
Regards, Paul.Hello
Go to the repository object navigator. Go to the table definitions --> usages --> Used in sql query sets
Regards Erik -
Module pool program, table control edit
Hi,
I am doing module pool programming with table control. I have a table control on my screen which is assigned to scarr table with New, Modify, Save, and Delete buttons. When I click on New and Save, the new record is adding to the table where as for Modify, I selected a row, edited, and clicked on save. Only the internal table is getting modified at the time but not the original table. How to update the table in database? Delete is also not working. Please give some idea on this or links related to table control with sample code.
Thanks in advance.Hi,
modify <table name>.
it will do it
Regards -
Problem in module pool with table control scrolling
hi,
i am using the table control in module pool,in the table control i have radion button for all the rows.
After i got the data into the table control ,if i select radio button and if i press vertical scroll bar button, that radio button is deselecting,how to solve this issue.
Please help me.Hi
Generally we don't keep radiobuttons in table control for selecting the records
We keep check boxes for selecting the records
Radio button is used to select a single from a group of records and at a time only one is selected, where as checkboxes at a time you can select a single or multiple.
So use checkboxes and code correctly see the doc for Table control
syntax:
CONTROLS .
if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.
u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.
Go through this urls.
www.****************
www.sap-img.com
Check the below links.
http://www.planetsap.com/howdo_a.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
http://sap.niraj.tripod.com/id25.html
Reward points if useful
Regards
Anji -
Hi Experts,
I am working on module pool Program using " Table Control ".
the below code is a part of program.
" Here i want insert new lines ( New values ). Please tell me that how to Do? "
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'INSERT'.
" Here i want insert new lines ( New values ). Please tell me that how to Do? "
WHEN 'TOGGLE'.
LOOP AT EMPLOYE-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 EMPLOYE-COLS FROM COLS INDEX SY-TABIX.
ENDLOOP.
WHEN 'DELETE'.
READ TABLE EMPLOYE-COLS INTO COLS WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
LOOP AT ITAB INTO ZEMPLOYE WHERE EMPID = 'X'.
DELETE ITAB.
ENDLOOP.
ENDIF.
ENDCASE.
ENDMODULE.
Its Urgent
Thank You.
BasuHi,
WHEN 'INSERT'.
" Here i want insert new lines ( New values ). Please tell me that how to Do? "
<b>Append initial line to EMPLOYE.</b>
Or
Change the table control attribute for rows.
Reward if helpful. -
Select current line through push button in module pool
Hi,
I have created one module pool program with table control. There I have inserted on push button where some logic is deployed.
Logic :-
If I push button on current line or any line, that line should be selected in the program. So that I can move that line to next internal table.
But, it always shows first line.
Please suggest the same.hi amol,
GET CURSOR only works on the number of table control lines that can be displayed on screen at any one time. So, if your screen can display only 4 lines, all you'll ever get from GET CURSOR is a number 1 to 4.
But your screen also knows which of your table control records is currently displayed as the top line of your table control. This information is held in field TC_ITEMS-TOP_LINE (where TC_ITEMS is the name of your table control). By combining these two bits of information, you can find the correct line number of your selected record.
For example in the case you describe where you are clicking on line 5 but GET CURSOR thinks it is line 4 because your screen has moved down a record, I would think that TC_ITEMS-TOP_LINE would be 2. Add 4 and 2 together, subtract 1 and you'll get your correct line number.
hope it helps,
vikas -
Table controls -page down and page up options
Hi Gurus,
I created one module pool program with table controls. I have to enter multiple records into table control so that it has to save in database table.Now iam able to enter only 15 to 16 records in table. I mean i have to write apgedown code so that i can able to insert more number of records. please tell me how to write the code.Send what to write in pAI and PBO.Hi,
There are two options to work with scrolling in table controls:
1) Using table control Wizard: By using wizard we can automatically create table controls in screen. Please check the scroll in the wizard steps. No need to write any code for scrolling(pageup and pagedown).
2) writing the code:
Very good example programs are given in SAP on Table controls. Please look at those you will get good idea. Below is the code which i have copied from example(Table Control with Scrolling):
REPORT demo_dynpro_tabcont_loop.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn,
fill TYPE i.
TABLES demo_conn.
DATA: lines TYPE i,
limit TYPE i.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
DESCRIBE TABLE itab LINES fill.
flights-lines = fill.
ENDMODULE.
MODULE fill_table_control OUTPUT.
READ TABLE itab INTO demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
lines = sy-loopc.
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 'NEXT_LINE'.
flights-top_line = flights-top_line + 1.
limit = fill - lines + 1.
IF flights-top_line > limit.
flights-top_line = limit.
ENDIF.
WHEN 'PREV_LINE'.
flights-top_line = flights-top_line - 1.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'NEXT_PAGE'.
flights-top_line = flights-top_line + lines.
limit = fill - lines + 1.
IF flights-top_line > limit.
flights-top_line = limit.
ENDIF.
WHEN 'PREV_PAGE'.
flights-top_line = flights-top_line - lines.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'LAST_PAGE'.
flights-top_line = fill - lines + 1.
WHEN 'FIRST_PAGE'.
flights-top_line = 0.
ENDCASE.
ENDMODULE. -
Regarding clearing of data in table control
In the module pool program using table control i need to enter data and save it to a customized table. But when i input data and press enter, all data gets cleared from the screen. Also i tried the same by appending into internal table. At that time data is displayed on the screen but all other rows gets inactive. Please provide a solution for this issue.
Still my problem is not solved. I am posting my PBO And PAI Modules. In the below example it_mat is the table control table and it_ormat is the internal table.
PBO Modules.
*&spwizard: pbo flow logic for tablecontrol 'TCMAT'
module TCMAT_change_tc_attr.
*&spwizard: module TCMAT_change_col_attr.
loop at IT_MAT
with control TCMAT
cursor TCMAT-current_line.
module TCMAT_get_lines.
*&spwizard: module TCMAT_change_field_attr
endloop.
*&spwizard: output module for tc 'TCMAT'. do not change this line!
*&spwizard: update lines for equivalent scrollbar
module TCMAT_change_tc_attr output.
describe table IT_MAT lines TCMAT-lines.
endmodule.
*&spwizard: output module for tc 'TCMAT'. do not change this line!
*&spwizard: get lines of tablecontrol
module TCMAT_get_lines output.
g_TCMAT_lines = sy-loopc.
READ TABLE IT_ORMAT INDEX SY-STEPL.
MODIFY IT_MAT FROM IT_ORMAT INDEX SY-STEPL.
endmodule.
PAI modules.----
*&spwizard: pai flow logic for tablecontrol 'TCMAT'
loop at IT_MAT.
chain.
field IT_MAT-MATNR.
field IT_MAT-MAKTX.
field IT_MAT-GROES.
field IT_MAT-ZEINR.
field IT_MAT-TCQTY.
field IT_MAT-IBRFLG.
module TCMAT_modify on chain-request.
endchain.
field IT_MAT-CFLG
module TCMAT_mark on request.
endloop.
module TCMAT_user_command.
*&spwizard: module TCMAT_change_tc_attr.
*&spwizard: module TCMAT_change_col_attr.
module TCMAT_modify input.
MODIFY IT_ORMAT FROM IT_MAT INDEX SY-STEPL.
endmodule.
*&spwizard: input modul for tc 'TCMAT'. do not change this line!
*&spwizard: mark table
module TCMAT_mark input.
data: g_TCMAT_wa2 like line of IT_MAT.
if TCMAT-line_sel_mode = 1
and IT_MAT-CFLG = 'X'.
loop at IT_MAT into g_TCMAT_wa2
where CFLG = 'X'.
g_TCMAT_wa2-CFLG = ''.
modify IT_MAT
from g_TCMAT_wa2
transporting CFLG.
endloop.
endif.
modify IT_MAT
index TCMAT-current_line
transporting CFLG.
endmodule.
*&spwizard: input module for tc 'TCMAT'. do not change this line!
*&spwizard: process user command
module TCMAT_user_command input.
OKCODE = sy-ucomm.
perform user_ok_tc using 'TCMAT'
'IT_MAT'
'CFLG'
changing OKCODE.
sy-ucomm = OKCODE.
endmodule. -
Hi,
iam developing object on modulepool.
can u pls send examples objects on modulepools.
thankhi ,
Here you go ....
Creation of table controls in mpools
Here you go with the complete steps for creating module pool programs using table control:
open se51, choose the icon like a table for table control . drag it and then place it in your screen . click on F6 and you will get a screen where youi need to provide the table name / field name that ( fields ) you are going to use in the screen and table control. after giving the ztable name click on get it from dictionary . you will get the list of available fields in a table. next choose the fields you wish to place in the table control , and if you want to place all fields in your table control then select every fields . after this you will get a structure which you should drag place inside the table control area .
double click on the table control , set the proper attributes, tickmark the horizontal and vertical scroll bars to appear in your TC in the screen . save , check and activate ..
following are the sample code you should follow to display datas in your table control ..
write the following code in the flow logic of the screen ............
process before output.
module tc_01_init.
loop at g_tc_01_itab
into g_tc_01_wa
with control tc_01
cursor tc_01-current_line.
module tc_01_move.
module tc_01_get_lines.
endloop.
module status_0001.
process after input.
loop at g_tc_01_itab.
chain.
field sflight-carrid.
field sflight-connid.
field sflight-fldate.
module tc_01_modify on chain-request.
endchain.
endloop.
module tc_01_user_command.
Write the following code in your Zmodulepool program !!
program z_tst_mpool_tc_01.
data: begin of l_tab_sflight occurs 10,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of l_tab_sflight.
tables: sflight.
types: begin of t_tc_01,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of t_tc_01.
data: g_tc_01_itab type t_tc_01 occurs 0,
g_tc_01_wa type t_tc_01. "work area
data: g_tc_01_copied. "copy flag
controls: tc_01 type tableview using screen 0001.
data: g_tc_01_lines like sy-loopc.
data: ok_code like sy-ucomm.
include z_tst_mpool_tc_01_pbo .
include z_tst_mpool_tc_01_pai .
include z_tst_mpool_tc_01_incl01 .
include z_tst_mpool_tc_01_status_0001.
include Z_TST_MPOOL_TC_01_PBO .
inside include
module tc_01_init output.
if g_tc_01_copied is initial.
select * from sflight
into corresponding fields
of table g_tc_01_itab.
g_tc_01_copied = 'X'.
refresh control 'TC_01' from screen '0001'.
endif.
endmodule.
module tc_01_move output.
move-corresponding g_tc_01_wa to sflight.
endmodule.
module tc_01_get_lines output.
g_tc_01_lines = sy-loopc.
endmodule.
Revert if further assistance needed ...
Regards,
Ranjita -
Error when doing table control
I am getting the following error when I am executing the
Module Pool Program for table control creation.
"Generation error in flow logic for Generation error(s) "
Can any body help me with the reason.Hi Makarand,
This could also come if you reference an incorrect table control. Make sure that the PAI and PBO loops use the right tab control.
Example: If you have a table control declared like this:
Controls: tab_ctr500 TYPE TABLEVIEW USING SCREEN '0500'.
In PBO and PAI..check that you are using
LOOP WITH CONTROL tab_ctr500
If this resolves the problem then please award points and close the post.
Thanks,
Anand -
Table control,any property
Hi Friends,
i have a small requirement in module pool programming with table control.
first thing what i have is a button called CREATE and Display
when i click on Create button i could see the table control with all the rows as editable which seems to be fine but
when i click on display i'm getting the data from the Database table and filling it in the table control . what my requirement is when i'm getting data from db table if we have 2 entries table control is showing 2 entries in the 2 rows which are editable and rest all rows seems to be non editable.The requirement here is i want all the rows to be editable when we are getting data from DB table(So that user can add new entries) and save. Please help me out.
Thanks,
Rohini
Moderator message : Search for available information, discussion locked.
Message was edited by: Vinod KumarHi Rohini,
i am facing similar kind of problem...in my table control when i click CREATE button, though the Data get Created, the data disappears from the table control. Does your table control behave like this,
if no can you say what have you done for that.
thank You & Regards.
Maybe you are looking for
-
Hi Group, i want to call a db2 database from an inbound proxy. For that i've installed on the XI computer a IBM db2 client. Testing connection from client side succeeds. To make the db2 driver also usable for jdbc adapter, i've deployed it with "aii_
-
Wow, this forum is hidden really well! Anyway, I've got a bit of a pickle here that hopefully someone can help me out with. I just finished up a project in Flash that we want to imbed on separate frames of the presentation, which seems to have gone f
-
Converting Music files to bookmarkable Audio Books
Converting Music files to bookmarkable Audio Books. It seems there are plenty of hacks out there but I have a real life and can't really be bothered with burning a CD with ACC files, etc. or anything else that takes more than half a minute. All I'd r
-
Invocation Target Exception when assembling a web service...
Hi All, I am trying to run an example provided at the following link in Oracle website:- http://www.oracle.com/technology/products/ias/toplink/technical/tips/jaxRpc11/index.htm This is an example provided for to configure the Oracle TopLink as a Cust
-
Figuring the best way to create a web site
hi i am an inexperienced java developer. i need to create web application where the user logs in. i want to know wish is the best way to go about. for eg,: should all my content be in one jsp file(logic, presentation and db logic) or should i servlet