Re Module pool Adding time
Hi
friends .. i had 2 screen in my module pool one for header and then for
details.
In detail screen there is from time and to time etc columns.
i want went user press enter ot click on insert button the next record
in that screen should be appear with totime in the column of from time.
for ex.
fromtime . totime
00.01.00 21.00.00
the nextline should be
21.01.00 -
in next line of totime user will enter .
can anybody tell me the logic for it .
answers will be rewarded points.
Hi,
Here is a sample code.
* program
REPORT z_tab_control.
DATA: BEGIN OF itab OCCURS 0,
frtime LIKE sy-uzeit,
totime LIKE sy-uzeit,
END OF itab.
DATA: okcode(20).
CONTROLS: tab1 TYPE TABLEVIEW USING SCREEN 9500.
DATA: IND TYPE I.
CALL SCREEN 9500.
*& Module USER_COMMAND_9500 INPUT
* text
MODULE user_command_9500 INPUT.
CASE okcode.
WHEN 'BACK'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'ADD'.
* add a new line.
CLEAR: itab.
DESCRIBE TABLE ITAB LINES IND.
READ TABLE ITAB INDEX IND.
IF SY-SUBRC = 0.
ITAB-FRTIME = ITAB-TOTIME + 60.
CLEAR: ITAB-TOTIME.
ENDIF.
APPEND itab.
ENDCASE.
CLEAR: OKCODE.
ENDMODULE. " USER_COMMAND_9500 INPUT
*& Module MODIF INPUT
* text
MODULE modif INPUT.
MODIFY itab INDEX tab1-current_line.
ENDMODULE. " MODIF INPUT
*& Module STATUS_9500 OUTPUT
* text
MODULE status_9500 OUTPUT.
DESCRIBE TABLE itab LINES tab1-lines.
IF itab[] IS INITIAL.
tab1-lines = -1.
ENDIF.
ENDMODULE. " STATUS_9500 OUTPUT
Flow logic of screen 9500.
PROCESS BEFORE OUTPUT.
MODULE STATUS_9500.
loop at itab with control tab1.
endloop.
PROCESS AFTER INPUT.
loop at itab.
MODULE MODIF.
endloop.
MODULE USER_COMMAND_9500.
Hope this would help you.
Thanks and regards,
S. Chandra Mouli.
Similar Messages
-
Stack over after Calling a module pool N times
Hi Experts,
There is a module pool 'A' which exports to memory a table and executes a CALL TRANSACTION 'B' (another module pool).
After saving program B, I must execute it again 'n times' without returning to caller program 'A', until I choose BACK.
So I wrote, WHEN 'SAVE'...CALL TRANSACTION 'B', in order to save-call itself-save-call itself-etc.
The problem is that after calling itself 5 times, the stack is over and it leaves program.
I tried using LEAVE TO CURRENT TRANSACTION, but it doesn't works because when I save B it goes out from program to SAP menu, instead of recalling itself.
Is there any way of doing this or deleting the stack?
Please help me out in this.
Thanks in Advance,
Lilian.Hi,
Instead of using the Call screen NNNN, use the Leave to scree NNN, then the stock will not overflow
Regards
Sudheer -
Custom field added in Module pool is not reflecting in SRM Shopping cart
Hi all,
I have to add a custom field for Plant in the Ship-To address subscreen(BBPSC01) in Shooping cart in SRM.
I have added the field in the program "saplbbp_sc_ui_its" in screen 310.
But I think need to write the HTML code/Java script in HTML template to trigger the code from module pool.
As I am new to this scenario, can anyone please let me know the procedure to follow.
Thanks,
Rakesh.Hello Anubhav,
If your new customer fields are not displayed dynamically, re-generate Dynpro concerned using report BBP_DYNPROS_GENERATE.
Regards.
Lauurent. -
Current time in module pool programming in text field
Hello Friends,
In module pool programming ther is a input output field for time i want the current system time should be displayed in that field and when user press saves tht time should get saved in the database tables.
regards,
SunnyHi, sunny,
If I understand your question correctly than I think that the following code will help you, you will have to write this code in the called program means where you are calling your screens.
data: tf_rec_no(10). u201Ctf_rec_nou201D is the field name on your screen
initialization.
write: sy-uzeit to tf_rec_no.
after this you can update db using this field.
Replay if any problem or you have some different query.
Kind Regards,
Faisal. -
Module Pool Programming adding line items.
Hi,
I am Doing Module Pool Programming in which I Should add line items and if the user gives the save button the data wil be saved in tables and SAP should generate one unique number.
Please give me inputs how to generate unique number and add n number of line items
correct inputs are rewarded
Thanks
Rasheed.Hi,
You may use Number Generator for generating unique ids in the system.
The keyword DEFAULT SERIAL gets a number generator for positive integers and can only be specified for columns that have the data type INTEGER, SMALLINT, and FIXED without decimal places (SERIAL).
The first value generated by the generator can be defined by specifying an unsigned integer (must be greater than 0). If this definition is missing, 1 is defined as the first value.
If an INSERT statement inserts the value in this column, you get the current number generator value and not the value 0.
Each table may not contain more than one column with the DEFAULT specification DEFAULT SERIAL.
Regards,
Renjith
Edited by: Renjith Michael on Oct 23, 2008 11:34 AM -
Adding a screen element in Module pool
Hi Experts,
How to add a screen element in module pool programming?
Thanks,
Sudha...........Hi sudha ,
To add screen elements in you module pool programming ,
i > Go the layout of the screen for which you want to have elements .
ii> Drag and drop the available elements from the left hand side .
iii> Be sure to have a name a name of the data elements that you have inserted .
iv>Check any dataelement is't showing red in color as red color signifies error .
v> Make sure to save and activate the layout.
Hope this would be clear .
Thanks
Lokesh -
Cursor position on screen data in module pool programming(urgent)
Hi all,
I developed a module pool program which will save the data after scanning the barcode data.
In my program screen 100 is there which contains field 2dbar. scanned data is comming to 2dbar field.
we r doing scan 4 times.once for vendor number,once for material no. like this.
After 1st scan, vendor number will come to field 2dbar.
Then I developed logic to put comma after each scanned data come to this field 2dbar.
MODULE put_comma INPUT.
CASE OK_CODE.
when ''.
move 2dbar to 2dbar1.
clear 2dbar.
concatenate 2dbar1 ',' into 2dbar2.
*replace 2dbar with 2dbar2 into 2dbar.
move 2dbar2 to 2dbar.
*write 2dbar2 to 2dbar.
condense 2dbar no-gaps.
*move '' to 2dbar.
*set cursor field 2dbar offset 5.
*write
ENDCASE.
ENDMODULE. " put_comma INPUT
By above logic, comma comes to the starting position of 2dbar after each scan. i.e cursor position is coming to the starting position of screen field 2dbar.
Now I need to move the cursor position after the comma position on 2dbar after each scan.
after 1st scan, 2dbar contains
vmotorola
then my logic puts a comma when u put enter on screen 100.
now 2dbar contains
vmotorola,
i should get the cursor position after the comma.but i am getting cursor position before 'v'.so how to move this cursor position beyond comma after each scan.
I added set cursor command but it is not working.plz
What is the logic, I need to put in PAI to move the cursor on selection screen.
Already the logic I have mentioned. with that logic, I can put comma.now I need to add cursor movement logic to move the cursoron on screen field 2dbar.
Plz reply me as it is urgent.
Thanks in advance.
Regards
pabitraCASE OK_CODE.
when ''.
move 2dbar to 2dbar1.
clear 2dbar.
concatenate 2dbar1 ',' into 2dbar2.
move 2dbar2 to 2dbar.
condense 2dbar no-gaps.
len = strlen ( 2dbar ).
len = len - 1.
set cursor field 2dbar offset len.
ENDCASE.
ENDMODULE. " put_comma INPUT -
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 -
Is there a user exit called when a module pool program is launch ?
Hello,
I know the exit 'EXIT_SAPLSABE_010' and it's very usefull for adding code before a report is launch.
But this exit is not called when a program is a "Module pool" type.
Is there a way to add my own code before this kind of program is launch ?
Thanks in advance,
Simon
Edited by: Simon Desbonnets on Mar 9, 2010 2:23 PMThanks for your answer.
No it's not for initializing values. It's for logging statistics into a specific table (program name, date ...).
The event "load-of-program" can be use for one program, it's not what I'm looking for.
I would like to know if there is an exit that is called each time a module pool program is executed. -
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 -
Multiple people working on one module pool - how?
Hello SDN Community,
I have a need for multiple people to be working on the same module pool. Since the forms are in a shared include inside the main program, how is it handled the multiple people writing code at the same time for the same module pool? Also the concurrent creation of screens in SE51 and pf-statuses in SE41?
Thank you,
Dean Atteberry.I was thinking about SAP module pool SAPMP50A (HR maintenance screen). It has lots of screens, includes, pf-status, etc. I realize that this has evolved over time and that lots had been added since original development.
But the original SAPMP50A must have had a lot of screens designed for it. Assuming it had, lets say 10 screens, did only one SAP developer build all 10 screens? Or did SAP put multiple people on it? And if so, how did they handle needing access to forms in same include with realities of editor locking?
Best way that I can see this now is that only one developer to a given module pool. Maybe a second one could build his part in a secondary module pool (and SE51/SE41) and then copy what they built to main module and SE51 and SE41.
Just trying to think this thing thru..... -
Remove field in Alv grid module pool
Hi Experts,
I have a requirement where in I need to remove a field on the display screen for a particular record.
In detail..
I have a created a module pool program where in the final out put was shown using CL_gui_alv_grid on the new screen.The normal display will start with a check box(editable),kunnr,ktokd etc..The requirement is for a particular record the check box should either disappear or disable.Please help me out in achieving this.Thanks in advance.
Initially I got very good response from Neha and Satya and felt very confident enough in the fix but I dont know where I am doing wrong the issue is not yet fixed.Satya or Neha can you tell me where am I doing wrong seeing the below code.
types:BEGIN OF lty_final,
chbox TYPE char1,
org_nam TYPE name1_gp,
vkorg TYPE vkorg,
parvw TYPE parvw,
ktokd TYPE ktokd,
kunnr TYPE kunnr,
pr_cnt TYPE char3,
fir_nam TYPE name1_gp,
las_nam TYPE name1_gp,
parau TYPE parau,
telf1 TYPE telf1,
STYLE TYPE lvc_t_styl, " New field added in the structure
END OF lty_final.
data:lt_final type table of lty_final,
ls_final type lty_final.
DATA : ls_stylerow TYPE lvc_s_styl ,
lt_styletab TYPE lvc_t_styl .
loop at lt_final into ls_final. """Final internal table
if ls_final-pr_cnt = lc_yes.
ls_stylerow-FIELDNAME = 'CHBOX'.
ls_stylerow-STYLE = cl_gui_alv_grid=>mc_style_disabled .
APPEND ls_stylerow TO lt_styletab.
CLEAR ls_stylerow.
ls_final-STYLE = LT_STYLETAB.
MODIFY lt_final INDEX sy-tabix FROM ls_final TRANSPORTING style.
endif.
endloop.
gs_layout-zebra = 'X'.
gs_layout-edit = ' '.
gs_layout-no_rowmark = 'X'.
gs_layout-stylefname = 'LT_STYLETAB'.
CALL METHOD grid_display->set_table_for_first_display
EXPORTING
i_save = 'X'
i_default = 'X'
is_layout = gs_layout
CHANGING
it_outtab = lt_final
it_fieldcatalog = gt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
With Regards,
Srini...Use the following codes in loop it will work.
Loop at lt_final into ls_final. """Final internal table
if ls_final-pr_cnt = lc_yes.
ls_stylerow-FIELDNAME = 'CHBOX'.
ls_stylerow-STYLE = cl_gui_alv_grid=>mc_style_disabled .
INSERT ls_stylerow INTO TABLE lt_final-STYLE. " use insert
*APPEND ls_stylerow TO lt_styletab.
*CLEAR ls_stylerow.
*ls_final-STYLE = LT_STYLETAB.
*MODIFY lt_final INDEX sy-tabix FROM ls_final TRANSPORTING style.
endif.
endloop.
Regards,
Gurpreet -
Icon display in Module pool screen not visible to some users
Hi,
I have added an icon in one of the module pool screen with dynamic quick info. The page is rendered fine and the info is also displayed well for most users except some. I can't figure out why the icon is not being displayed for some users.
Do someone has any solution for this?
Thanks,
SumithAs I recall, the icons are actually stored in a file on each PC so some users may have a corrupted or out-of-date file with the icons. You can look for posting on "how to add an icon" to see a discussion on this topic.
I found some useful info at:
Create and Add Icons to table ICON?
Message was edited by: Charles Folwell -
How to make a fld mandatory in module pool program?
I need help on following 2 things
I have module pool program created, in that many screen subscreens created.
1.I want to make a field mandatory
second one is, I have a general tab and data tab.
General tab screen - 2101
Data tab = 2102
In general tab, I have edited the values (change mode), when change the values and try to save it,
It is holding old value.but If i exucute the transaction once again, it is showing the changed value(new value)
For ex: there is a date field value is 03/08/2009
If I change this to 03/09/2009 and press on Save button from the standard menu, still it is showing the value 03/08/2009. but I execute this transaction once again it is showing the value as 03/09/2009
I will be thankful if someone helps me hereHi Chitra,
Go to the properties of the filed select program tab and say input required.
then you will get the problem solved.
For second one actually its saving but not displaying the saved value at the same time ,
for this you write the select statement after saving , so that once save is execute m, select statement also will execute and it will display the newly saved value.
so after saving imdeatly u write the select statement.
like case sy-ucomm.
when 'SAVE'.
insert ztable.
select filed from z table.
endcase.
let me know if ur problem solved.
Regards
Rajendra -
To give colours for a certain row in table control in module pool
Hi,
In module pool,,,,,When I am displaying the Table Control......Suppose in some rows personnel no. is there and for the person who has exited from the company should be highlighted with red colour.
Please some code..
thanks..Hi Jayasree,
I think I had a similar requirement to have a one column on a particular row
available for input where all other rows for that column were not. It took
me a while to figure this out but it was quite simple. I expect it will
work for colour changes too.
In Process Before Output
LOOP AT INTERNAL TABLE INTO WA WITH CONTROL TC
Call Module
END LOOP
In the module program the condition on which the colour change / input
status etc has to be changed using
IF condition = true
LOOP AT SCREEN
IF SCREEN-NAME = column name
Make your colour / input status change
MODIFY SCREEN
ENDIF
ENDLOOP
ENDIF
I hope this helps you.
Please search the forum before adding a new thread.
Maybe you are looking for
-
I have Adobe Photoshop Elements 8 for Windows 7. I need to re-install it because my computer crashed. I saved the outer box, but I do not see a serial number and it is asking for it when I am trying to install the CD software. I went online, but the
-
Load sound in java application without use of newAudioClip api.
In personal java 1.2, (JDK1.1.8), the method newAudioClip is unavailable to load sound. What other api can one use to load sound into the java application in this case?
-
InDesign - Potential Client Abuse
Hi there, Please let me know if I am way out of line here. I am very new at this. My client is an insurance company. They have several clients who need brochures for their products. All of the brochures are to be branded with each client company's lo
-
I used trial of CS, and now need to purchase, but how?
Hi All, As a newbie to CS et al I am finding things a little confusing so would appreciate some clarity. I used the trial, havent used CS for a couple of months, need to use it now and want to convert trial to purchase but all the 'cloud' noise is ma
-
I had FCS2 running on this MacPro for over a year. Snow Leopard crashed last weekend and I have since installed a fresh version of Snow Leopard. I'm now trying to install FCS2 and am getting this error when I click on "Install Final Cut Pro:" *The op