Module Pool Info REQ???
Hi
I need some info abt the deque-nque concept in module pool,also abt the commit area statemnts in it.
I had an issue,in which the user runs an application in mdoule pool,like 3 users simaltenouly at a location,if any time they press the SAVE button at the same time,the application generate a unique no. all time,but in the case of same time SAVE butting pressing,one 1 no is generated & is same displyed to all users,thus only 1 records is stored in the table,but in actual it shd be 3.
So i need to solve this ,can any one tell me how to do ?
I sthete any deque-nque concept whcih can be applicabe here,or any think like I can lock the no of users at a particular location or i can find the no. of users & than generate the no. at a location based on the users.also in the case of same time SAVE button pressing.
Plz tell me in brief,i am a beginner in module pool.
Regds
yes,this is the requirement.
Current the application is there,but the bug is there,which i hv to remove,it has to work in the same way as u written above.
Can u tell me how to do this?
the code is like this :
when 'save'.
SELECT MAX( slip_no ) INTO v_slipno FROM zhzlagucha_wb
WHERE werks = werks AND exyear = exyear.
zhzlagucha_wb-slip_no = v_slipno + 1.
APPEND zhzlagucha_wb TO agucha_wb.
zhzlagucha_wb-addn_fld3 = itab-slip_no.
MODIFY zhzlagucha_wb.
So i jeust need if 3-4 users simultanesouly press the save button,they shd get the indiual uniqye no.at there screen,& same shd be saved in table.
Similar Messages
-
Module Pool help req??
hi
Can we make a redio button in the Module pool progm as a default while in the screen painter?
plz tell me,i don't know how to do it?
regds
vipinHi,
Use control bar in the left side of the painter window and after that give the fucntion code for the radiobutton.
While creating the screen,u give the function code for the radio button ...
In the PAI of that screen.
If sy-ucomm = 'Fcode of that radio bbutton'.
loop at screen.
if screen-name = 'xyz'.(give all the screen names which u want to activate)
screen-active = '1'.
modify screen.
endif.
endloop.
endif.
In the Screen Painter, you can assign a function code (up to 20 characters long) to checkboxes and radio buttons.
Checkboxes and radio buttons without a function code behave like normal input/output fields. Clicking the object changes the contents of the field, but does not trigger the PAI event. (Clicking a pushbutton, on the other hand, always triggers the PAI event, even if it has an empty function code.)
When a function code is assigned to a checkbox or radio button, clicking it not only changes the field contents, but also triggers the PAI event and places the function code in the OK CODE field. For further information, refer to Evaluating Function Codes.
While it is possible to assign an individual function code to each checkbox, you can only assign one function code to all of the radio buttons in a group. When you assign a function code to a radio button in the Screen Painter, the system automatically applies the same function code to all of the other radio buttons in the group.
You can use checkboxes and radio buttons with function codes as follows:
· For processing parts of screens (context-sensitive processing). For example, only when a radio button or checkbox is selected is particular data read and placed in the corresponding input/output fields.
· You can fill fields with patterns depending on checkboxes or radio buttons. A typical example would be formatting settings for letters. The input fields can all be processed separately, but it is possible to fill all input fields simultaneously and consistently by choosing a pattern.
· You can control dynamic screen modifications directly using checkboxes or radio buttons. For example, you can make sure that an input/output field cannot accept input until the user selects a radio button.
As when you create pushbuttons, you should ensure when you assign function codes to checkboxes and radio buttons that they do not coincide with function codes from the GUI status.
PROGRAM demo_dynpro_check_radio.
DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
box TYPE c.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'RADIO'.
IF radio1 = 'X'.
field1 = 'Selected!'.
CLEAR: field2, field3.
ELSEIF radio2 = 'X'.
field2 = 'Selected!'.
CLEAR: field1, field3.
ELSEIF radio3 = 'X'.
field3 = 'Selected!'.
CLEAR: field1, field2.
ENDIF.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
Thanks,
Sakthi C
Message was edited by:
Sakthi Saravanan C -
Module pool domain text display info req?
hi
i had an req to show a filed MATNR on a screen in module pool pgm,there shd be a i/p filed for material,user can select the material from the list of available materials,along with the test to be displayed for the filed next to material nos.
the list of mateiral is based on the login user name.
i am able to display the material list,but text is not coming.
pls tell me how to show the text next to matnr no. in list.
i had used the code:
loop at itab_carrid.
clear:text.
CALL FUNCTION 'ADS2KIPBRO_GET_DOMAIN_TEXT'
EXPORTING
E_TABLE = 'MARA'
E_FIELD = 'MATNR'
E_VALUE = itab_carrid-matnr
IMPORTING
I_TEXT = text
EXCEPTIONS
ILLEGAL_INPUT = 1
DOMAIN_NOT_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.
move text to itab_carrid-text1.
modify itab_carrid transporting text1.
endloop.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.hi
tell me,if i made a i/p field on screen from the data variable declared in my program
like :data:actvt(3) type c.
than on layout of screen:I/P filed-actvt.
now i want to provide the f4 to this.i had written the POV for the filed,the data is there in itab,but not poping out.
code:PROCESS ON VALUE-REQUEST.
FIELD ACTVT MODULE create_dropdown_box.
TYPES: BEGIN OF type_carrid,
actvt(3) type c,
text1(40) type c,
END OF type_carrid.
DATA: itab_carrid type Type_carrid occurs 0 with header line.
itab_carrid-actvt = '001'.
append itab_carrid.
itab_carrid-actvt = '002'.
append itab_carrid.
itab_carrid-actvt = '003'.
append itab_carrid.
itab_carrid-actvt = '004'.
append itab_carrid.
itab_carrid-actvt = '005'.
append itab_carrid.
itab_carrid-actvt = '006'.
append itab_carrid.
itab_carrid-actvt = '007'.
append itab_carrid.
endif.
clear:itab_carrid.
loop at itab_carrid.
clear:text.
CALL FUNCTION 'ADS2KIPBRO_GET_DOMAIN_TEXT'
EXPORTING
E_TABLE = 'YLOGON1'
E_FIELD = 'ACTVT'
E_VALUE = itab_carrid-actvt
IMPORTING
I_TEXT = text
EXCEPTIONS
ILLEGAL_INPUT = 1
DOMAIN_NOT_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.
move text to itab_carrid-text1.
modify itab_carrid transporting actvt text1.
endloop.
clear:itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ACTVT'
DYNPNR = SY-DYNNR
DYNPPROG = SY-REPID
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
plz tell me how to pop out this help in screen. -
Module pool screen I/P Validation info req?
hi
please tel me how to validate a screen I/P in module pool.
i had a screen:1000.
there in an I/P date from: date to:
user wants,if any one puts date to < date from,there shd be an error msg,i had done it,but after it,all other fileds are disabled,but i want after error msg,it shd allow me to do the modification.
please tell how to do.
vipinKeep the validation in one module, say, m_validate.
write the following code in screen flow logic.
CHAIN.
FIELD: date_from,
date_to.
MODULE m_validate.
ENDCHAIN . -
How to have a search help in module pool without using Process on value req
Can someone please tell me what r the ways if any to have F4 help in the module pool screen
with out using POV ?Hi,
They are two ways to define search help for an object...
BY using POV
or
go to screen Layout and double click on the field you want F4 help and Pass the Search help math code for feild at the
place of Search_help field aand also you can add parameter-id at this place to provide search help.
go to screen Layout -->double click on the field you want F4 help
-->Pass the Search help math code for feild at the place of Search_help
save and activate..
reagrds,
Prabhudas -
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 -
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 call a "Z"module pool program in a "z"report
Hi Guys,
I have two reports .
1. Report : uploads a tab delimited " .Txt1" file and update the "z1" table
".TXT1" : File contains 4 fields
2. Module pool. :Uploads a a tab delimited " .Txt2" file and update another "z2" table
".TXT2" file contains the 4 fileds of ".TXT1" and also 2 extra fields.
I want to merge (call) the module pool program in the Report and perform the upload function using only one ".TXT" file.Please do guide me precisely .
*Report:*
REPORT zrswbgcs009 NO STANDARD PAGE HEADING MESSAGE-ID zwb
LINE-SIZE 185.
TABLES: zgcs_foc. "FOC Parts Table
*data count buffer
DATA: read_cnt(6) TYPE p, "Find read record
update_cnt(6) TYPE p, "OK record
error_cnt(6) TYPE p. "Error record
*file buffer(FOC)
DATA: BEGIN OF FOC_inrec OCCURS 0,
CUSTOMER(10), "Customer
PART_CODE(18), "Parts Code
REF_NO(35), "Ref No.
REF_DATE(10), "Ref Date
QTY(12), "Parts Qty
TEXT(100), "Remark
END OF FOC_inrec.
*file buffer
DATA: BEGIN OF inrec OCCURS 0,
CUSTOMER(10), "Customer
PART_CODE(18), "Parts Code
REF_NO(35), "Ref No.
REF_DATE(10), "Ref Date
QTY(12), "Parts Qty
PRICE(15), "Parts Price
WAERK(5), "Parts Currency
TEXT(100), "Remark
END OF inrec.
DATA : v_file LIKE rlgrap-filename.
DATA gt_zgcs_foc LIKE zgcs_foc OCCURS 0 WITH HEADER LINE.
DATA gs_zgcs_foc LIKE zgcs_foc.
*File name ACCEPT--------------------------------------------------
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
*Company code
PARAMETERS: p_comp LIKE zgcs_imei-company OBLIGATORY.
PARAMETERS: pcfile LIKE rlgrap-filename OBLIGATORY LOWER CASE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETERS: HQfile RADIOBUTTON GROUP b2.
SELECTION-SCREEN COMMENT 7(20) text-101 FOR FIELD HQfile.
SELECTION-SCREEN POSITION 31.
PARAMETERS: SUBfile RADIOBUTTON GROUP b2.
SELECTION-SCREEN COMMENT 37(20) text-102 FOR FIELD SUBfile.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK box WITH FRAME.
SELECTION-SCREEN: COMMENT /2(40) text-011, COMMENT 42(40) text-001,
ULINE,
COMMENT /2(40) text-012, COMMENT 42(40) text-002,
COMMENT /2(40) text-013, COMMENT 42(40) text-003,
COMMENT /2(40) text-014, COMMENT 42(40) text-004,
COMMENT /2(40) text-015, COMMENT 42(40) text-005,
COMMENT /2(40) text-016, COMMENT 42(40) text-006,
COMMENT /2(40) text-017, COMMENT 42(40) text-007,
COMMENT /2(40) text-018, COMMENT 42(40) text-008,
COMMENT /42(40) text-009.
SELECTION-SCREEN END OF BLOCK box.
* -- AT SELECTION SCREEN ON
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pcfile.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = space
def_path = 'C:\'
mask = ',*.txt,*.TXT.'
mode = 'O'
title = ' '
IMPORTING
filename = pcfile
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
*-----------------------------start--------------------------------
START-OF-SELECTION.
CLEAR: read_cnt, update_cnt, error_cnt.
REFRESH gt_zgcs_foc. CLEAR gs_zgcs_foc.
PERFORM file_upload_from_pc.
SORT gt_zgcs_foc.
DELETE ADJACENT DUPLICATES FROM gt_zgcs_foc
COMPARING COMPANY CUSTOMER PART_CODE REF_NO REF_DATE.
*// customer code check
DATA: LT_ZESTD LIKE ZESTD OCCURS 0 WITH HEADER LINE.
IF NOT gt_zgcs_foc[] IS INITIAL.
SELECT COMPANY CUSTOMER CURRENCY
INTO CORRESPONDING FIELDS OF TABLE LT_ZESTD
FROM ZESTD
FOR ALL ENTRIES IN gt_zgcs_foc
WHERE COMPANY = gt_zgcs_foc-COMPANY
AND CUSTOMER = gt_zgcs_foc-CUSTOMER.
ENDIF.
SORT LT_ZESTD BY COMPANY CUSTOMER.
*// part code check
DATA: LT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
IF NOT gt_zgcs_foc[] IS INITIAL.
SELECT *
INTO TABLE LT_MARA
FROM MARA
FOR ALL ENTRIES IN gt_zgcs_foc
WHERE MATNR = gt_zgcs_foc-PART_CODE.
ENDIF.
SORT LT_MARA BY MATNR.
LOOP AT gt_zgcs_foc.
*// customer code check
READ TABLE LT_ZESTD WITH KEY
COMPANY = gt_zgcs_foc-COMPANY
CUSTOMER = gt_zgcs_foc-CUSTOMER.
IF SY-SUBRC <> 0.
WRITE:/'Invalid Customer code ',
gt_zgcs_foc-COMPANY, ' ',
gt_zgcs_foc-CUSTOMER.
STOP.
ENDIF.
*// part code check
READ TABLE LT_MARA WITH KEY MATNR = gt_zgcs_foc-PART_CODE
BINARY SEARCH.
IF SY-SUBRC <> 0.
WRITE:/ 'Invalid part code ', gt_zgcs_foc-PART_CODE.
STOP.
ENDIF.
*// REF_NO
TRANSLATE gt_zgcs_foc-REF_NO TO UPPER CASE.
SHIFT gt_zgcs_foc-REF_NO LEFT DELETING LEADING SPACE.
IF gt_zgcs_foc-REF_NO = SPACE.
WRITE:/'Ref No. is blank'.
STOP.
ENDIF.
*// REF_DATE
IF gt_zgcs_foc-REF_DATE = 0.
WRITE:/'Invalid Ref Date'.
STOP.
ENDIF.
*// QTY
* IF gt_zgcs_foc-QTY CO ' 0123456789'.
* ELSE.
* WRITE:/ gt_zgcs_foc-QTY, ' Invalid Qty value'.
* STOP.
* ENDIF.
ENDLOOP.
* Insert/Update table
* MODIFY zgcs_foc FROM TABLE gt_zgcs_foc.
INSERT zgcs_foc FROM TABLE gt_zgcs_foc.
IF sy-subrc EQ 0.
COMMIT WORK.
DESCRIBE TABLE gt_zgcs_foc LINES update_cnt.
error_cnt = read_cnt - update_cnt.
ELSE.
ROLLBACK WORK.
error_cnt = read_cnt - update_cnt.
ENDIF.
ULINE.
FORMAT COLOR 3.
WRITE: / 'Read count :', read_cnt.
WRITE: / 'Insert/Update count :', update_cnt.
WRITE: / 'Error count :', error_cnt.
FORMAT COLOR OFF.
*end-of-selection--------------------------------------------------
END-OF-SELECTION.
*& Form FILE_UPLOAD_FROM_PC
FORM file_upload_from_pc.
IF pcfile IS INITIAL.
WRITE: / 'SELECT UPLOAD FILE !'.
ELSE.
MOVE pcfile TO v_file.
* HQ file upload
IF HQfile EQ 'X'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = v_file
filetype = 'DAT'
TABLES
data_tab = FOC_inrec
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
WRITE: / 'FILE UPLOAD :', sy-subrc.
ENDIF.
LOOP AT FOC_inrec.
ADD 1 TO read_cnt.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = FOC_inrec-customer
importing
output = FOC_inrec-customer.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = FOC_inrec-part_code
importing
output = FOC_inrec-part_code.
MOVE-CORRESPONDING FOC_inrec TO gs_zgcs_foc.
MOVE p_comp TO gs_zgcs_foc-company.
MOVE gs_zgcs_foc-qty TO gs_zgcs_foc-balan.
MOVE sy-uname TO gs_zgcs_foc-ERNAM.
MOVE sy-datum TO gs_zgcs_foc-ERDAT.
MOVE sy-UZEIT TO gs_zgcs_foc-ERZET.
* Source(1:HQ,2:SUB,0:Etc)
MOVE '1' TO gs_zgcs_foc-source.
APPEND gs_zgcs_foc TO gt_zgcs_foc.
ENDLOOP.
* SGE file upload
ELSE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = v_file
filetype = 'DAT'
TABLES
data_tab = inrec
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
WRITE: / 'FILE UPLOAD :', sy-subrc.
ENDIF.
LOOP AT inrec.
ADD 1 TO read_cnt.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = inrec-customer
importing
output = inrec-customer.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = FOC_inrec-part_code
importing
output = FOC_inrec-part_code.
MOVE-CORRESPONDING inrec TO gs_zgcs_foc.
MOVE p_comp TO gs_zgcs_foc-company.
MOVE gs_zgcs_foc-qty TO gs_zgcs_foc-balan.
MOVE sy-uname TO gs_zgcs_foc-ERNAM.
MOVE sy-datum TO gs_zgcs_foc-ERDAT.
MOVE sy-UZEIT TO gs_zgcs_foc-ERZET.
* Source(1:HQ,2:SUB,0:Etc)
MOVE '2' TO gs_zgcs_foc-source.
APPEND gs_zgcs_foc TO gt_zgcs_foc.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM.
*MODULE POOL::*
*& Module Name : Warranty Bill
*& Sub-Module : W/B
*& Description : Parts Q'ty Adjust(Sales & Warranty)
*& Program Name : ZRSWBP004
*& History
*& Date Author Reason
*& 2007.05.08 Song, Ji-Hyun Initial Coding Req.by WH.Song
*& Logic Process
* - CONDITIONS
* Company, Customer, Material
* - PROCESS
* Display,Insert,Update data in the T/B ZESP04
REPORT zrswbp004 NO STANDARD PAGE HEADING
MESSAGE-ID 00
LINE-SIZE 250
LINE-COUNT 50.
* G L O B A L V A R I A B L E S *
TABLES : zesp04.
DATA : BEGIN OF itab_list OCCURS 0,
company LIKE zesp04-company,
customer LIKE zesp04-customer,
material LIKE zesp04-material,
adj_date LIKE zesp04-adj_date,
adjust LIKE zesp04-adjust,
reason LIKE zesp04-reason,
reason_code LIKE zesp04-reason_code,
doc_no LIKE zesp04-doc_no,
in_date LIKE zesp04-in_date,
create_id LIKE zesp04-create_id,
END OF itab_list.
DATA : itab_upload LIKE TABLE OF zesp04 WITH HEADER LINE.
DATA : s_mode(10).
DATA : table_name(10) VALUE 'ZESP04'.
DATA : tot_cnt TYPE i.
DATA : ref_flag(1).
* M A C R O D E F I N E *
DEFINE conversion_kunnr.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = &1
importing
output = &1.
END-OF-DEFINITION.
DEFINE conversion_material.
call function 'CONVERSION_EXIT_MATN1_INPUT'
exporting
input = &1
importing
output = &1.
END-OF-DEFINITION.
* S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE title1.
PARAMETERS : company LIKE zesp04-company MEMORY ID buk MODIF ID v1
OBLIGATORY.
SELECT-OPTIONS : customer FOR zesp04-customer MEMORY ID kun
MODIF ID v1.
SELECT-OPTIONS : material FOR zesp04-material MEMORY ID mat
MODIF ID v1.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 3.
SELECTION-SCREEN COMMENT 3(12) text-002 MODIF ID v2.
PARAMETERS : up_flag AS CHECKBOX MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(12) text-001 MODIF ID v2.
PARAMETERS : p_fname(300) LOWER CASE MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE title2.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(53) text-003 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(10) text-004 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(12) text-005 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(12) text-006 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(15) text-007 MODIF ID v2.
PARAMETERS : df1 TYPE c RADIOBUTTON GROUP grp1.
SELECTION-SCREEN COMMENT 24(13) text-012 MODIF ID v2.
PARAMETERS : df2 TYPE c RADIOBUTTON GROUP grp1.
SELECTION-SCREEN COMMENT 41(11) text-013 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(14) text-008 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(11) text-009 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(14) text-010 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(10) text-011 MODIF ID v2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.
INCLUDE zrswbp004_pbo.
INCLUDE zrswbp004_pai.
INITIALIZATION.
title1 = ' Parts Quantity Adjustment '.
title2 = ' Text File Layout '.
* S T A R T O F S E L E C T I O N *
TOP-OF-PAGE.
PERFORM write_header.
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM write_header.
START-OF-SELECTION.
IF up_flag = 'X'.
PERFORM upload_data.
ELSE.
PERFORM select_data.
SET PF-STATUS 'PF01' EXCLUDING 'SAVE'.
PERFORM display_data.
ENDIF.
AT USER-COMMAND.
PERFORM user_command.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM get_filename.
*& Form SELECT_DATA
* Select Data for Display
FORM select_data.
SELECT * FROM (table_name)
INTO CORRESPONDING FIELDS OF TABLE itab_list
WHERE company = company
AND customer IN customer
AND material IN material.
CHECK sy-subrc <> 0.
WRITE: 'No data found with your option.'.
ENDFORM. " SELECT_DATA
*& Form DISPLAY_DATA
* Display Data following Condition
FORM display_data.
LOOP AT itab_list.
FORMAT COLOR 2 INTENSIFIED.
WRITE : / '|' NO-GAP.
WRITE : (07) itab_list-company CENTERED NO-GAP, '|' NO-GAP,
(10) itab_list-customer CENTERED NO-GAP, '|' NO-GAP,
(20) itab_list-material CENTERED NO-GAP, '|' NO-GAP,
(10) itab_list-adj_date CENTERED NO-GAP, '|' NO-GAP,
(15) itab_list-adjust RIGHT-JUSTIFIED NO-GAP, '|'
NO-GAP,
(55) itab_list-reason LEFT-JUSTIFIED NO-GAP, '|' NO-GAP,
(11) itab_list-reason_code CENTERED NO-GAP, '|' NO-GAP,
(10) itab_list-doc_no CENTERED NO-GAP, '|' NO-GAP,
(10) itab_list-in_date CENTERED NO-GAP, '|' NO-GAP,
(12) itab_list-create_id CENTERED NO-GAP, '|' NO-GAP.
FORMAT INTENSIFIED OFF.
HIDE itab_list.
ENDLOOP.
WRITE : / sy-uline(171).
ENDFORM. " DISPLAY_DATA
*& Form WRITE_HEADER
* Write Report Header
FORM write_header.
DATA : line(1024).
CLEAR line WITH '-'.
DESCRIBE TABLE itab_list LINES tot_cnt.
FORMAT INTENSIFIED ON.
WRITE : 15 'Parts Quantity Adjustment'.
SKIP.
WRITE : / 'Total Count : ', tot_cnt.
WRITE : /.
WRITE : (171) sy-uline.
WRITE : / '|' NO-GAP.
WRITE : (07) 'Company' CENTERED NO-GAP, '|' NO-GAP,
(10) 'Customer' CENTERED NO-GAP, '|' NO-GAP,
(20) 'Material' CENTERED NO-GAP, '|' NO-GAP,
(10) 'Adj. Date' CENTERED NO-GAP, '|' NO-GAP,
(15) 'Adjust' CENTERED NO-GAP, '|' NO-GAP,
(55) 'Reason' CENTERED NO-GAP, '|' NO-GAP,
(11) 'Reason Code' CENTERED NO-GAP, '|' NO-GAP,
(10) 'Doc No' CENTERED NO-GAP, '|' NO-GAP,
(10) 'IN DATE' CENTERED NO-GAP, '|' NO-GAP,
(12) 'CREATE ID' CENTERED NO-GAP, '|' NO-GAP.
WRITE : /(171) sy-uline.
FORMAT INTENSIFIED OFF.
ENDFORM. " WRITE_HEADER
*& Form UPLOAD_DATA
* Data Upload from File
FORM upload_data.
DATA : l_filename LIKE rlgrap-filename,
temp_dateformat TYPE dateformat.
IF df1 = 'X'.
temp_dateformat = 'YYYY.MM.DD'.
ELSE.
temp_dateformat = 'DD.MM.YYYY'.
ENDIF.
MOVE p_fname TO l_filename.
CHECK l_filename NE space.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = l_filename
filetype = 'DAT'
dat_d_format = temp_dateformat
TABLES
data_tab = itab_list
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9.
IF sy-subrc NE 0.
MESSAGE s000 WITH 'File upload is failed!'.
STOP.
ELSE.
CLEAR : itab_upload, itab_upload[].
LOOP AT itab_list.
MOVE-CORRESPONDING itab_list TO itab_upload.
conversion_kunnr itab_upload-customer.
conversion_material itab_upload-material.
itab_upload-mandt = sy-mandt.
itab_upload-in_date = sy-datum.
itab_upload-create_id = sy-uname.
*>>>>Insert by GSCHOI 2007.11.08
IF itab_list-adj_date+0(6) NE sy-datum+0(6).
MESSAGE i368 WITH 'Adjust month must same as current month!'.
ROLLBACK WORK.
STOP.
ENDIF.
*<<<<End
APPEND itab_upload.
INSERT INTO (table_name) VALUES itab_upload.
IF sy-subrc EQ 0.
CONTINUE.
ELSEIF sy-subrc EQ 4.
MESSAGE s368 WITH 'Duplicated Data Error!'.
ROLLBACK WORK.
STOP.
ELSE.
MESSAGE s368 WITH 'File Error!'.
ROLLBACK WORK.
STOP.
ENDIF.
ENDLOOP.
ENDIF.
IF sy-subrc EQ 0.
MESSAGE s368 WITH 'Uploaded Successfully!'.
ENDIF.
ENDFORM. " UPLOAD_DATA
*& Form USER_COMMAND
* User Command Execution in Screen 1000
FORM user_command.
MOVE-CORRESPONDING itab_list TO zesp04.
CASE sy-ucomm.
WHEN 'INSERT'.
PERFORM insert_item.
WHEN 'UPDATE'.
PERFORM update_item.
WHEN 'DISPLAY'.
PERFORM display_item.
WHEN 'REFRESH'.
PERFORM refresh_list.
ENDCASE.
IF ref_flag = 'Y'.
PERFORM refresh_list.
CLEAR ref_flag.
ENDIF.
ENDFORM. " USER_COMMAND
*& Form INSERT_ITEM
* When Clicking Insert Button
FORM insert_item.
CLEAR : s_mode.
CLEAR : zesp04.
s_mode = 'INSERT'.
CALL SCREEN '100'.
ENDFORM. " INSERT_ITEM
*& Form UPDATE_ITEM
* When Clicking Update Button
FORM update_item.
CLEAR : s_mode.
s_mode = 'UPDATE'.
CALL SCREEN '100'.
ENDFORM. " UPDATE_ITEM
*& Form DISPLAY_ITEM
* When Clicking Display Button
FORM display_item.
CLEAR : s_mode.
s_mode = 'DISPLAY'.
CALL SCREEN '100'.
ENDFORM. " DISPLAY_ITEM
*& Form REFRESH_LIST
* When Clicking Refresh Button or Returning Display Screen
FORM refresh_list.
CLEAR : itab_list, itab_list[].
PERFORM select_data.
sy-lsind = sy-lsind - 1.
PERFORM display_data.
ENDFORM. " REFRESH_LIST
*& Form GET_FILENAME
* Get Filename
FORM get_filename.
DATA: l_fname LIKE ibipparms-path .
DATA : p_name LIKE sy-repid.
p_name = sy-repid.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = p_name
dynpro_number = sy-dynnr
field_name = ''
IMPORTING
file_name = l_fname.
p_fname = l_fname.
ENDFORM. " GET_FILENAME
Edited by: Matt on Nov 24, 2008 11:24 AM - surrounded the ABAP with tagsHi,
Use SUBMIT statement in your first Report zrswbgcs009 at the end, to call the Modulepool program zrswbp004.
do a search in SDN you will get lot of threads on SUBMIT statement with selection screen.
SUBMIT... [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>].
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm
Regards
Bala Krishna -
Screen Programming(Module Pool ) using Abap Objects
Hi gurus.,
I need to create a module pool program with tabstrips and tablecontrols using Abap objects...plz guide me how i can achieve this... i am very much confused.. i dont know how and where to start .. plz send me documents and sample codes related to this topic..Also hoe i can implement f4 help in screen fields..
Regards.,
S.SivakumarHi Sivakumar,
Go through the following links:
[url]http://www.savefile.com/download/156691?PHPSESSID=c49d6bed6630d830f3270f7eab51e547 [url]
[url]http://www.sapdb.info/category/sap-ebooks[url]
[url]http://sap.niraj.tripod.com/id25.html[url]
[url]http://abaplovers.blogspot.com/2008/03/sap-abap-tutorial-module-pool_17.html[url]
Thank you,
Prasad G.V.K
Edited by: Craig Cmehil on Jul 1, 2008 9:48 PM -
How to DOWNLOAD a whole module pool program????
Hi..
can anybody tell me how to download a <b>whole module pool program</b> into my desktop with .sap extension???
Actually i want to download a whole module pool program from a server so that i can upload the same program into another sap server instead of writing the whole code.
Thanx in advance......the program is exits..
i don't y it is not for ur.....
i am sending d code for the same....
create a program and check...
*& Report REPTRAN *
*& This report allows to display and save complete programs and *
*& function modules. *
*& This report was originally written by Frank Wolf, Xaption GmbH. *
*& Its original name was ZREPTRAN (see www.abaps.de). *
REPORT reptran LINE-SIZE 170 .
TABLES: d010inc, trdir, eudb, title, d020t, trkey, tfdir, tmdir, tadir,
seoclass, seoclassdf, seoclassex, seoclasstx, seometarel,
seocompo, seocompodf, seocompoex, seocompotx, seoimplrel,
seomapatt, seomapcls, seoredef, seofriends, seotypepls,
seosubco, seosubcodf, seosubcoex, seosubcotx.
TYPES: abapline(255).
TYPES: BEGIN OF ty_tit,
code TYPE rsoldleng-title,
text TYPE title-text_line,
END OF ty_tit.
TYPES: BEGIN OF ty_reptxt,
id TYPE textpool-id,
key TYPE textpool-key,
entry TYPE textpool-entry,
length(4) TYPE n,
END OF ty_reptxt.
TYPES: BEGIN OF ty_d020t,
prog TYPE d020t-prog,
dynr TYPE d020t-dynr,
dtxt TYPE d020t-dtxt,
END OF ty_d020t.
TYPES: BEGIN OF dynp_rel_type, "Dynpro-Releases
rel(1),
dot(1),
version(2),
END OF dynp_rel_type.
TYPES: BEGIN OF ty_seocompodf_t.
INCLUDE STRUCTURE seocmpkey.
TYPES: version TYPE seocompodf-version,
alias TYPE seocompodf-alias,
redefin TYPE seocompodf-redefin,
exposure TYPE seocompodf-exposure,
state TYPE seocompodf-state,
editorder(4) TYPE n,
locked TYPE seocompodf-locked,
dispid(4) TYPE n.
INCLUDE STRUCTURE seochange.
INCLUDE STRUCTURE seomtdapx.
INCLUDE STRUCTURE seoevtapx.
INCLUDE STRUCTURE seotypapx.
TYPES: typtype TYPE seocompodf-typtype,
type TYPE seocompodf-type,
tableof TYPE seocompodf-tableof,
srcrow1(4) TYPE n,
srccolumn1(2) TYPE n,
srcrow2(4) TYPE n,
srccolumn2(2) TYPE n.
INCLUDE STRUCTURE seocmpref.
TYPES: END OF ty_seocompodf_t.
TYPES: BEGIN OF ty_seosubcodf_t.
INCLUDE STRUCTURE seoscokey.
TYPES: version TYPE seosubcodf-version,
editorder(4) TYPE n,
dispid(4) TYPE n.
INCLUDE STRUCTURE seochange.
TYPES: pardecltyp TYPE seosubcodf-pardecltyp,
parpasstyp TYPE seosubcodf-parpasstyp,
typtype TYPE seosubcodf-typtype,
type TYPE seosubcodf-type,
tableof TYPE seosubcodf-tableof,
srcrow1(4) TYPE n,
srccolumn1(2) TYPE n,
srcrow2(4) TYPE n,
srccolumn2(2) TYPE n,
parvalue TYPE seosubcodf-parvalue,
paroptionl TYPE seosubcodf-paroptionl.
INCLUDE STRUCTURE seoexcapx.
TYPES: END OF ty_seosubcodf_t.
Release bis 3.1
*INCLUDE mseuxcom.
DATA: eu_key TYPE rseu1_key.
Titel
DATA: tit TYPE STANDARD TABLE OF ty_tit WITH HEADER LINE.
Release from 4.6
DATA: fun4 TYPE STANDARD TABLE OF rsmpe_funt WITH HEADER LINE.
DATA: ctx4 TYPE STANDARD TABLE OF rsmpe_ctx WITH HEADER LINE.
DATA: mtx4 TYPE STANDARD TABLE OF rsmpe_mnlt WITH HEADER LINE.
DATA: men4 TYPE STANDARD TABLE OF rsmpe_men WITH HEADER LINE.
DATA: act4 TYPE STANDARD TABLE OF rsmpe_act WITH HEADER LINE.
DATA: doc4 TYPE STANDARD TABLE OF rsmpe_atrt WITH HEADER LINE.
DATA: sta4 TYPE STANDARD TABLE OF rsmpe_stat WITH HEADER LINE.
DATA: set4 TYPE STANDARD TABLE OF rsmpe_staf WITH HEADER LINE.
DATA: pfk4 TYPE STANDARD TABLE OF rsmpe_pfk WITH HEADER LINE.
DATA: but4 TYPE STANDARD TABLE OF rsmpe_but WITH HEADER LINE.
DATA: tit4 TYPE STANDARD TABLE OF rsmpe_titt WITH HEADER LINE.
DATA: stx4 TYPE STANDARD TABLE OF rsmptexts WITH HEADER LINE.
DATA: adm4 TYPE rsmpe_adm.
Release from 4.6c
DATA: biv46c TYPE STANDARD TABLE OF rsmpe_buts WITH HEADER LINE.
DATA: reports TYPE STANDARD TABLE OF trdir-name WITH HEADER LINE,
reportname TYPE string.
DATA: i_repsrc TYPE STANDARD TABLE OF abapline WITH HEADER LINE.
DATA: i_reptx TYPE STANDARD TABLE OF textpool WITH HEADER LINE.
DATA: i_reptxt TYPE STANDARD TABLE OF ty_reptxt WITH HEADER LINE.
DATA: i_adm4 TYPE STANDARD TABLE OF rsmpe_adm WITH HEADER LINE.
DATA: i_tmd TYPE STANDARD TABLE OF tmdir.
DATA: i_tfd TYPE STANDARD TABLE OF tfdir.
DATA: i_cls TYPE STANDARD TABLE OF seoclass.
DATA: i_cdf TYPE STANDARD TABLE OF seoclassdf.
DATA: i_clx TYPE STANDARD TABLE OF seoclassex.
DATA: i_clt TYPE STANDARD TABLE OF seoclasstx.
DATA: i_cmr TYPE STANDARD TABLE OF seometarel.
DATA: i_cmp TYPE STANDARD TABLE OF seocompo.
DATA: i_cmd TYPE STANDARD TABLE OF seocompodf WITH HEADER LINE.
DATA: i_cmd_t TYPE STANDARD TABLE OF ty_seocompodf_t WITH HEADER LINE.
DATA: i_cmx TYPE STANDARD TABLE OF seocompoex.
DATA: i_cmt TYPE STANDARD TABLE OF seocompotx.
DATA: i_irl TYPE STANDARD TABLE OF seoimplrel.
DATA: i_mat TYPE STANDARD TABLE OF seomapatt.
DATA: i_mac TYPE STANDARD TABLE OF seomapcls.
DATA: i_red TYPE STANDARD TABLE OF seoredef.
DATA: i_frd TYPE STANDARD TABLE OF seofriends.
DATA: i_tpl TYPE STANDARD TABLE OF seotypepls.
DATA: i_sco TYPE STANDARD TABLE OF seosubco.
DATA: i_scd TYPE STANDARD TABLE OF seosubcodf WITH HEADER LINE.
DATA: i_scd_t TYPE STANDARD TABLE OF ty_seosubcodf_t WITH HEADER LINE.
DATA: i_scx TYPE STANDARD TABLE OF seosubcoex.
DATA: i_sct TYPE STANDARD TABLE OF seosubcotx.
DATA: i_inc TYPE STANDARD TABLE OF d010inc-include WITH HEADER LINE.
DATA: i_d020t TYPE STANDARD TABLE OF ty_d020t WITH HEADER LINE.
DATA: hdr TYPE d020s,
fld TYPE STANDARD TABLE OF d021s WITH HEADER LINE,
src TYPE STANDARD TABLE OF d022s WITH HEADER LINE,
mat TYPE STANDARD TABLE OF d023s WITH HEADER LINE.
CONSTANTS:
stars(64) VALUE
"#EC NOTEXT
comment1(64) VALUE
'* THIS FILE IS GENERATED BY THE SCREEN PAINTER. *',
"#EC NOTEXT
comment2(64) VALUE
'* NEVER CHANGE IT MANUALLY, PLEASE ! *',
"#EC NOTEXT
dynpro_text(8) VALUE '%_DYNPRO', "#EC NOTEXT
header_text(8) VALUE '%_HEADER', "#EC NOTEXT
params_text(8) VALUE '%_PARAMS', "#EC NOTEXT
descript_text(13) VALUE '%_DESCRIPTION', "#EC NOTEXT
fields_text(8) VALUE '%_FIELDS', "#EC NOTEXT
kreuz(1) VALUE 'x', "#EC NOTEXT
flowlogic_text(11) VALUE '%_FLOWLOGIC'. "#EC NOTEXT
DATA: header_char TYPE scr_chhead.
DATA: fields_char TYPE STANDARD TABLE OF scr_chfld WITH HEADER LINE.
DATA: dynp_char TYPE STANDARD TABLE OF scr_chfld WITH HEADER LINE.
DATA: prog_len TYPE p.
DATA: BEGIN OF dynp,
prog TYPE d020s-prog,
dnum TYPE d020s-dnum,
END OF dynp.
DATA:
scrp_rel TYPE dynp_rel_type VALUE '4.02'. "Rel. Scrp. 4.02
scrp_rel TYPE dynp_rel_type VALUE '4.60'. "Rel. Scrp. 4.6A
DATA dynp_rel TYPE dynp_rel_type. "akt. Rel. Dynpro
DATA: dynpro_rel(4).
DATA status.
DATA prog_len_akt TYPE p.
DATA release.
DATA rows LIKE sy-curow.
DATA lines LIKE sy-cucol.
DATA: filename TYPE string.
DATA: subrc LIKE sy-subrc.
DATA: os(10).
DATA: delux VALUE '/'.
DATA: delwn VALUE '\'.
DATA: delim.
DATA: dirux(250) VALUE '-l>dir.tmp'.
DATA: dirwn(250) VALUE '/Q /Cdir>dir.tmp'.
DATA: command(250).
DATA: shellux(250) VALUE 'bash'.
DATA: shellwn(250) VALUE 'cmd.exe'.
DATA: shell(250).
DATA: file TYPE rlgrap-filename.
DATA: answer.
DATA: incname TYPE d010inc-include.
DATA: repname TYPE d010inc-include.
DATA: rest1 TYPE d010inc-include.
DATA: rest2 TYPE d010inc-include.
DATA: kz_renam.
DATA: classname TYPE seoclsname.
DATA: classtype(2).
DATA: offset TYPE i.
DATA: savepath(250).
SELECT-OPTIONS: report FOR trdir-name.
SELECTION-SCREEN: SKIP.
SELECT-OPTIONS: cnam FOR trdir-cnam MATCHCODE OBJECT user_addr,
unam FOR trdir-unam MATCHCODE OBJECT user_addr,
devclass FOR tadir-devclass,
subc FOR trdir-subc,
rstat FOR trdir-rstat,
cdat FOR trdir-cdat,
udat FOR trdir-udat.
SELECTION-SCREEN: SKIP.
PARAMETERS: path(250).
SELECTION-SCREEN: SKIP.
PARAMETERS: display RADIOBUTTON GROUP func,
save RADIOBUTTON GROUP func,
savedspl RADIOBUTTON GROUP func.
SELECTION-SCREEN: SKIP.
PARAMETERS: codeonly AS CHECKBOX.
SELECTION-SCREEN: SKIP.
*PARAMETERS: suffix(80) LOWER CASE.
DATA: suffix(80) TYPE c.
LOAD-OF-PROGRAM.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'DEVCLASS' DUMMY
ID 'OBJTYPE' FIELD 'PROG'
ID 'OBJNAME' FIELD 'REPTRAN'
ID 'PGROUP' DUMMY
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
MESSAGE e059(EU) WITH 'REPTRAN'.
ENDIF.
INITIALIZATION.
GET PARAMETER ID 'REPTRAN_PATH' FIELD path.
IF path IS INITIAL.
path = 'C:\ABAPS\'.
ENDIF.
save = 'X'.
codeonly = 'X'.
CALL FUNCTION 'WS_QUERY'
EXPORTING
ENVIRONMENT = ' '
FILENAME = ' '
query = 'OS'
WINID = ' '
IMPORTING
return = os
EXCEPTIONS
inv_query = 1
no_batch = 2
frontend_error = 3
OTHERS = 4.
IF sy-subrc = 0 AND
( os CS 'OS2' OR os CS 'DOS' OR os CS 'NT' ).
delim = delwn.
command = dirwn.
shell = shellwn.
ELSE.
delim = delux.
command = dirux.
shell = shellux.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR path.
GET CURSOR FIELD path VALUE path.
filename = path.
PERFORM fileselector.
AT SELECTION-SCREEN.
IF report[] IS INITIAL.
IF NOT reports[] IS INITIAL.
report = 'IEQ'.
report-low = reports.
APPEND report.
MESSAGE i208(00)
WITH 'Report/BSP application was also identified'(009).
ELSE.
MESSAGE e208(00)
WITH 'Enter report or BSP application or enter path'(011).
ENDIF.
ENDIF.
START-OF-SELECTION.
offset = strlen( path ) - 1.
IF path+offset(1) <> '\'.
CONCATENATE path '\' INTO path.
ENDIF.
SET PARAMETER ID 'REPTRAN_PATH' FIELD path.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
eu_key-sprsl = sy-langu.
IF NOT save IS INITIAL OR
NOT display IS INITIAL OR
NOT savedspl IS INITIAL.
DOWNLOAD PROGRAMS
SELECT name FROM trdir
INTO TABLE reports
WHERE name IN report
AND cnam IN cnam
AND unam IN unam
AND subc IN subc
AND rstat IN rstat
AND cdat IN cdat
AND udat IN udat.
IF sy-subrc <> 0.
LOOP AT report.
CONCATENATE report(3) 'SAPL' report+3 INTO report.
MODIFY report.
ENDLOOP.
SELECT name FROM trdir
INTO TABLE reports
WHERE name IN report
AND cnam IN cnam
AND unam IN unam
AND subc IN subc
AND rstat IN rstat
AND cdat IN cdat
AND udat IN udat.
ENDIF.
IF sy-subrc <> 0.
MESSAGE i208(00)
WITH 'The program/function name entered does not exist!'(082).
ENDIF.
LOOP AT reports.
Check if report is in development class
classtype = reports+30.
IF reports(5) NE 'CL_O2'.
IF classtype = 'CP'.
tadir-obj_name = reports.
SHIFT tadir-obj_name RIGHT DELETING TRAILING space.
SHIFT tadir-obj_name RIGHT BY 2 PLACES.
SHIFT tadir-obj_name RIGHT DELETING TRAILING '='.
SHIFT tadir-obj_name LEFT DELETING LEADING space.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'CLAS'
AND obj_name = tadir-obj_name
AND devclass IN devclass.
ENDIF.
IF classtype <> 'CP' OR sy-subrc <> 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = reports
AND devclass IN devclass.
IF sy-subrc <> 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name = reports
AND devclass IN devclass.
ENDIF.
IF sy-subrc <> 0 AND
( reports(4) = 'SAPL' OR reports(4) = 'sapl' ).
reportname = reports+4.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name = reportname
AND devclass IN devclass.
ENDIF.
ENDIF.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
ENDIF.
reportname = reports.
PERFORM makepath USING reportname
path
CHANGING savepath.
PERFORM writeinfo USING reportname
savepath.
REFRESH: i_repsrc, i_reptx, i_reptxt, i_inc,
sta4, ctx4, fun4, mtx4, doc4, tit4, men4, act4, but4,
pfk4, set4, stx4, biv46c,
i_d020t, i_adm4,
i_tmd, i_tfd, i_cls, i_cdf, i_clx, i_clt, i_cmr, i_cmp,
i_cmd, i_cmx, i_cmt, i_irl, i_mat, i_mac, i_red, i_frd,
i_tpl, i_sco, i_scd, i_scx, i_sct, i_cmd_t, i_scd_t.
CLEAR: adm4.
eu_key-name = reports.
READ REPORT reports INTO i_repsrc.
IF codeonly <> 'X'.
READ TEXTPOOL reports INTO i_reptx.
ENDIF.
LOOP AT i_reptx.
MOVE-CORRESPONDING i_reptx TO i_reptxt.
APPEND i_reptxt.
ENDLOOP.
IF NOT display IS INITIAL OR
NOT savedspl IS INITIAL.
PERFORM show_rep.
ENDIF.
IF classtype = 'CP' OR classtype = 'IP'.
classname = reports(30).
TRANSLATE classname USING '= '.
SELECT * FROM tmdir INTO TABLE i_tmd
WHERE classname = classname.
SELECT * FROM seoclass INTO TABLE i_cls
WHERE clsname = classname.
SELECT * FROM seoclassdf INTO TABLE i_cdf
WHERE clsname = classname.
SELECT * FROM seoclassex INTO TABLE i_clx
WHERE clsname = classname.
SELECT * FROM seoclasstx INTO TABLE i_clt
WHERE clsname = classname.
SELECT * FROM seometarel INTO TABLE i_cmr
WHERE clsname = classname.
SELECT * FROM seocompo INTO TABLE i_cmp
WHERE clsname = classname.
SELECT * FROM seocompodf INTO TABLE i_cmd
WHERE clsname = classname.
LOOP AT i_cmd.
MOVE-CORRESPONDING i_cmd TO i_cmd_t.
APPEND i_cmd_t.
ENDLOOP.
SELECT * FROM seocompoex INTO TABLE i_cmx
WHERE clsname = classname.
SELECT * FROM seocompotx INTO TABLE i_cmt
WHERE clsname = classname.
SELECT * FROM seoimplrel INTO TABLE i_irl
WHERE clsname = classname.
SELECT * FROM seomapatt INTO TABLE i_mat
WHERE clsname = classname.
SELECT * FROM seomapcls INTO TABLE i_mac
WHERE clsname = classname.
SELECT * FROM seoredef INTO TABLE i_red
WHERE clsname = classname.
SELECT * FROM seofriends INTO TABLE i_frd
WHERE clsname = classname.
SELECT * FROM seotypepls INTO TABLE i_tpl
WHERE clsname = classname.
SELECT * FROM seosubco INTO TABLE i_sco
WHERE clsname = classname.
SELECT * FROM seosubcodf INTO TABLE i_scd
WHERE clsname = classname.
LOOP AT i_scd.
MOVE-CORRESPONDING i_scd TO i_scd_t.
APPEND i_scd_t.
ENDLOOP.
SELECT * FROM seosubcoex INTO TABLE i_scx
WHERE clsname = classname.
SELECT * FROM seosubcotx INTO TABLE i_sct
WHERE clsname = classname.
ELSE.
CLEAR classtype.
ENDIF.
IF codeonly <> 'X'.
SELECT * FROM tfdir INTO TABLE i_tfd
WHERE pname = reports.
CALL FUNCTION 'RS_CUA_INTERNAL_FETCH'
EXPORTING
program = reports
LANGUAGE =
STATE = 'A'
IMPORTING
adm = adm4
LANGU =
AUTHOR =
DATE =
TIME =
CAUTHOR =
CDATE =
CTIME =
GDATE =
GTIME =
TABLES
sta = sta4
fun = fun4
men = men4
mtx = mtx4
act = act4
but = but4
pfk = pfk4
set = set4
doc = doc4
tit = tit4
biv = biv46c
EXCEPTIONS
not_found = 1
unknown_version = 2
OTHERS = 3.
SELECT ddnr text_line FROM title INTO TABLE tit
WHERE ddlanguage = eu_key-sprsl AND
progname = eu_key-name.
SELECT * FROM rsmptexts INTO TABLE stx4
WHERE progname = eu_key-name AND
sprsl = eu_key-sprsl.
SELECT prog dynr dtxt FROM d020t INTO TABLE i_d020t
WHERE prog = reports AND
NOT dtxt LIKE 'SEL_SCREEN%'.
ENDIF.
IF NOT classtype IS INITIAL.
reports = classname.
ENDIF.
TRANSLATE reports TO LOWER CASE.
TRANSLATE reports USING '/.'.
IF NOT save IS INITIAL OR
NOT savedspl IS INITIAL.
CONCATENATE savepath reports suffix '.txt' INTO filename.
PERFORM download TABLES i_repsrc USING filename
'Source'(003).
IF NOT i_reptxt[] IS INITIAL.
CONCATENATE savepath reports suffix '_txt.txt' INTO filename.
PERFORM download TABLES i_reptxt USING filename
'Text elements'(004).
ENDIF.
ENDIF.
SELECT include FROM d010inc INTO TABLE i_inc
WHERE master = eu_key-name.
DELETE i_inc WHERE table_line(1) = '<'.
DELETE i_inc WHERE table_line(1) = '>'.
DELETE i_inc WHERE table_line = 'DB__SSEL'.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_inc[] IS INITIAL.
CONCATENATE savepath reports suffix '_inc.txt' INTO filename.
PERFORM download TABLES i_inc USING filename
'Include List'(033).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_tmd[] IS INITIAL.
CONCATENATE savepath reports suffix '_tmd.txt' INTO filename.
PERFORM download TABLES i_tmd USING filename
'Methods List'(048).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cls[] IS INITIAL.
CONCATENATE savepath reports suffix '_cls.txt' INTO filename.
PERFORM download TABLES i_cls USING filename
'Class Entry'(050).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cdf[] IS INITIAL.
CONCATENATE savepath reports suffix '_cdf.txt' INTO filename.
PERFORM download TABLES i_cdf USING filename
'Class Definition'(051).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_clx[] IS INITIAL.
CONCATENATE savepath reports suffix '_clx.txt' INTO filename.
PERFORM download TABLES i_clx USING filename
'Class Remote Info'(052).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_clt[] IS INITIAL.
CONCATENATE savepath reports suffix '_clt.txt' INTO filename.
PERFORM download TABLES i_clt USING filename
'Class Description'(053).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cmr[] IS INITIAL.
CONCATENATE savepath reports suffix '_cmr.txt' INTO filename.
PERFORM download TABLES i_cmr USING filename
'Class Meta Relations'(054).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cmp[] IS INITIAL.
CONCATENATE savepath reports suffix '_cmp.txt' INTO filename.
PERFORM download TABLES i_cmp USING filename
'Class Components'(055).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cmd_t[] IS INITIAL.
CONCATENATE savepath reports suffix '_cmd.txt' INTO filename.
PERFORM download TABLES i_cmd_t USING filename
'Class Components Definitions'(056).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cmx[] IS INITIAL.
CONCATENATE savepath reports suffix '_cmx.txt' INTO filename.
PERFORM download TABLES i_cmx USING filename
'Class Components Remote Infos'(057).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_cmt[] IS INITIAL.
CONCATENATE savepath reports suffix '_cmt.txt' INTO filename.
PERFORM download TABLES i_cmt USING filename
'Class Components Descriptions'(058).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_irl[] IS INITIAL.
CONCATENATE savepath reports suffix '_irl.txt' INTO filename.
PERFORM download TABLES i_irl USING filename
'Class Components Relation Types'(059).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_mat[] IS INITIAL.
CONCATENATE savepath reports suffix '_mat.txt' INTO filename.
PERFORM download TABLES i_mat USING filename
'Class Mapping Attributes'(060).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_mac[] IS INITIAL.
CONCATENATE savepath reports suffix '_mac.txt' INTO filename.
PERFORM download TABLES i_mac USING filename
'Class Mapping Classes'(061).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_red[] IS INITIAL.
CONCATENATE savepath reports suffix '_red.txt' INTO filename.
PERFORM download TABLES i_red USING filename
'Class Redefinitions'(062).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_frd[] IS INITIAL.
CONCATENATE savepath reports suffix '_frd.txt' INTO filename.
PERFORM download TABLES i_frd USING filename
'Class Friends'(063).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_tpl[] IS INITIAL.
CONCATENATE savepath reports suffix '_tpl.txt' INTO filename.
PERFORM download TABLES i_tpl USING filename
'Class Type-Pools'(064).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_sco[] IS INITIAL.
CONCATENATE savepath reports suffix '_sco.txt' INTO filename.
PERFORM download TABLES i_sco USING filename
'Class Sub Components'(065).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_scd_t[] IS INITIAL.
CONCATENATE savepath reports suffix '_scd.txt' INTO filename.
PERFORM download TABLES i_scd_t USING filename
'Class Sub Components Definitions'(066).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_scx[] IS INITIAL.
CONCATENATE savepath reports suffix '_scx.txt' INTO filename.
PERFORM download TABLES i_scx USING filename
'Class Sub Components Remote Infos'(067).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_sct[] IS INITIAL.
CONCATENATE savepath reports suffix '_sct.txt' INTO filename.
PERFORM download TABLES i_sct USING filename
'Class Sub Components Descriptions'(068).
ENDIF.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_tfd[] IS INITIAL.
CONCATENATE savepath reports suffix '_tfd.txt' INTO filename.
PERFORM download TABLES i_tfd USING filename
'Function List'(049).
ENDIF.
IF NOT i_inc[] IS INITIAL.
LOOP AT i_inc.
REFRESH: i_reptx, i_reptxt.
READ REPORT i_inc INTO i_repsrc.
IF codeonly <> 'X'.
READ TEXTPOOL i_inc INTO i_reptx.
ENDIF.
LOOP AT i_reptx.
MOVE-CORRESPONDING i_reptx TO i_reptxt.
APPEND i_reptxt.
ENDLOOP.
IF NOT display IS INITIAL OR
NOT savedspl IS INITIAL.
PERFORM show_inc.
ENDIF.
TRANSLATE i_inc TO LOWER CASE.
TRANSLATE i_inc USING '/.'.
IF NOT save IS INITIAL OR
NOT savedspl IS INITIAL.
CONCATENATE savepath i_inc suffix '.txt' INTO filename.
PERFORM download TABLES i_repsrc USING filename
'Include Source'(032).
IF NOT i_reptxt[] IS INITIAL.
CONCATENATE savepath i_inc suffix '_txt.txt'
INTO filename.
PERFORM download TABLES i_reptxt USING filename
'Text elements'(004).
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
IF NOT i_d020t[] IS INITIAL.
LOOP AT i_d020t.
IMPORT DYNPRO hdr fld src mat ID i_d020t.
CALL FUNCTION 'RS_SCRP_UPGRADE_DYNPRO'
TABLES
f = fld
m = mat
CHANGING
h = hdr.
IF src[] IS INITIAL.
DELETE i_d020t.
CONTINUE.
ENDIF.
CLEAR src.
READ TABLE src INDEX 1.
IF src-line CS 'Do not change'.
DELETE i_d020t.
CONTINUE.
ENDIF.
CALL FUNCTION 'RS_SCRP_GET_SCREEN_INFOS'
EXPORTING
dynnr = hdr-dnum
progname = hdr-prog
with_fieldlist = 'X'
IMPORTING
lines = lines
columns = rows
TABLES
fieldlist = fld
EXCEPTIONS
dynpro_does_not_exist = 01
no_field_list = 02.
hdr-bzmx = lines.
hdr-bzbr = rows.
IF NOT display IS INITIAL OR
NOT savedspl IS INITIAL.
PERFORM show_dyn.
ENDIF.
IF NOT save IS INITIAL OR
NOT savedspl IS INITIAL.
PERFORM dynpro_download.
ENDIF.
ENDLOOP.
IF ( NOT save IS INITIAL OR
NOT savedspl IS INITIAL ) AND
NOT i_d020t[] IS INITIAL.
CONCATENATE savepath reports suffix '_dyn.txt' INTO filename.
PERFORM download TABLES i_d020t USING filename
'Dynpro List'(040).
ENDIF.
ENDIF.
IF NOT save IS INITIAL OR
NOT savedspl IS INITIAL.
IF NOT sta4[] IS INITIAL.
CONCATENATE savepath reports suffix '_sta.txt' INTO filename.
PERFORM download TABLES sta4 USING filename
'GUI Status'(013).
ENDIF.
IF NOT ctx4[] IS INITIAL.
CONCATENATE savepath reports suffix '_ctx.txt' INTO filename.
PERFORM download TABLES ctx4 USING filename
'Object Codes'(045).
ENDIF.
IF NOT fun4[] IS INITIAL.
CONCATENATE savepath reports suffix '_fun.txt' INTO filename.
PERFORM download TABLES fun4 USING filename
'Function Texts'(014).
ENDIF.
IF NOT men4[] IS INITIAL.
CONCATENATE savepath reports suffix '_men.txt' INTO filename.
PERFORM download TABLES men4 USING filename
'Menus'(015).
ENDIF.
IF NOT tit4[] IS INITIAL.
CONCATENATE savepath reports suffix '_sti.txt' INTO filename.
PERFORM download TABLES tit4 USING filename
'Title Codes'(042).
ENDIF.
IF NOT mtx4[] IS INITIAL.
CONCATENATE savepath reports suffix '_mtx.txt' INTO filename.
PERFORM download TABLES mtx4 USING filename
'Menu Texts'(016).
ENDIF.
IF NOT act4[] IS INITIAL.
CONCATENATE savepath reports suffix '_act.txt' INTO filename.
PERFORM download TABLES act4 USING filename
'Menu Bars'(047).
ENDIF.
IF NOT but4[] IS INITIAL.
CONCATENATE savepath reports suffix '_but.txt' INTO filename.
PERFORM download TABLES but4 USING filename
'Push Buttons'(018).
ENDIF.
IF NOT pfk4[] IS INITIAL.
CONCATENATE savepath reports suffix '_pfk.txt' INTO filename.
PERFORM download TABLES pfk4 USING filename
'PF Keys'(019).
ENDIF.
IF NOT adm4 IS INITIAL.
APPEND adm4 TO i_adm4.
CONCATENATE savepath reports suffix '_adm.txt' INTO filename.
PERFORM download TABLES i_adm4 USING filename
'Management Information'(043).
ENDIF.
IF NOT set4[] IS INITIAL.
CONCATENATE savepath reports suffix '_set.txt' INTO filename.
PERFORM download TABLES set4 USING filename
'Function Sets'(020).
ENDIF.
IF NOT stx4[] IS INITIAL.
CONCATENATE savepath reports suffix '_stx.txt' INTO filename.
PERFORM download TABLES stx4 USING filename
'Status Texts'(023).
ENDIF.
IF NOT doc4[] IS INITIAL.
CONCATENATE savepath reports suffix '_doc.txt' INTO filename.
PERFORM download TABLES doc4 USING filename
'Status Short Texts'(024).
ENDIF.
IF NOT biv46c[] IS INITIAL.
CONCATENATE savepath reports suffix '_biv.txt' INTO filename.
PERFORM download TABLES biv46c USING filename
'Invariant Functions'(048).
ENDIF.
IF NOT tit[] IS INITIAL.
CONCATENATE savepath reports suffix '_tit.txt' INTO filename.
PERFORM download TABLES tit USING filename
'Title Bars'(030).
ENDIF.
ENDIF.
ULINE.
ENDLOOP.
ENDIF.
REFRESH reports.
*& Form DOWNLOAD
FORM download TABLES tabelle
USING value(filename)
component.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
filename = filename
filetype = 'ASC'
IMPORTING
FILELENGTH =
TABLES
data_tab = tabelle
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
OTHERS = 5.
IF reports IS INITIAL.
WRITE: / appls.
ELSE.
WRITE: / reports.
ENDIF.
WRITE: /(20) component.
IF sy-subrc = 0.
WRITE: 'successfully downloaded'(001).
PERFORM getfilename USING filename
CHANGING filename.
WRITE: '->', filename.
ELSE.
WRITE: 'not downloaded, RC ='(002), sy-subrc.
ENDIF.
ENDFORM. " DOWNLOAD
*& Form FILESELECTOR
FORM fileselector.
DATA: repname(250).
DATA: fdpos(2) TYPE p.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
def_path = path
mask = ',.txt,.txt.'
mode = 'O'
TITLE = ' '
IMPORTING
filename = file
RC =
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
subrc = sy-subrc.
path = file.
CLEAR: sy-fdpos, sy-subrc.
fdpos = 1.
WHILE sy-subrc = 0.
fdpos = fdpos + sy-fdpos + 1.
SEARCH path FOR delim STARTING AT fdpos.
ENDWHILE.
fdpos = fdpos - 1.
path = path(fdpos).
repname = file.
CLEAR sy-subrc.
WHILE sy-subrc = 0.
SHIFT repname LEFT.
SHIFT repname LEFT UP TO delim.
ENDWHILE.
SHIFT repname RIGHT UP TO '.'.
SHIFT repname RIGHT.
SHIFT repname LEFT DELETING LEADING space.
TRANSLATE repname TO UPPER CASE.
reports = repname.
APPEND reports.
ENDFORM. " FILESELECTOR
*& Form LS
FORM ls.
TYPES: c80(80).
DATA: dirtab TYPE STANDARD TABLE OF c80 WITH HEADER LINE.
DATA: datei TYPE string.
DATA: i LIKE sy-tabix.
DATA: endtime LIKE sy-uzeit.
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
DOCUMENT = ' '
cd = path
commandline = command
INFORM = ' '
program = shell
STAT = ' '
WINID = ' '
OSMAC_SCRIPT = ' '
OSMAC_CREATOR = ' '
WIN16_EXT = ' '
EXEC_RC = ' '
IMPORTING
RBUFF =
EXCEPTIONS
frontend_error = 1
no_batch = 2
prog_not_found = 3
illegal_option = 4
OTHERS = 5.
IF sy-subrc NE 0.
MESSAGE e001(pc).
Error when executing the WS program
ENDIF.
CONCATENATE path 'dir.tmp' INTO datei.
GET TIME.
endtime = sy-uzeit + 3.
WHILE sy-uzeit < endtime.
GET TIME.
ENDWHILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = datei
filetype = 'ASC'
IMPORTING
FILELENGTH =
TABLES
data_tab = dirtab
EXCEPTIONS
file_read_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
OTHERS = 5.
IF sy-subrc NE 0.
MESSAGE e001(pc).
Error when executing the WS program
ENDIF.
REFRESH reports.
i = 1.
DO.
SEARCH dirtab FOR '.txt' STARTING AT i.
IF sy-subrc NE 0.
EXIT.
ENDIF.
READ TABLE dirtab INDEX sy-tabix.
i = sy-tabix + 1.
CHECK dirtab NS 'txt_.txt'.
SHIFT dirtab LEFT UP TO space.
SHIFT dirtab LEFT DELETING LEADING space.
SHIFT dirtab LEFT UP TO space.
SHIFT dirtab LEFT DELETING LEADING space.
SHIFT dirtab LEFT UP TO space.
SHIFT dirtab RIGHT UP TO '.'.
SHIFT dirtab RIGHT.
SHIFT dirtab LEFT DELETING LEADING space.
IF NOT dirtab IS INITIAL.
TRANSLATE dirtab TO LOWER CASE.
APPEND dirtab TO reports.
ENDIF.
ENDDO.
SORT reports.
DELETE ADJACENT DUPLICATES FROM reports.
ENDFORM. " LS
*& Form SHOW_DYN
FORM show_dyn.
Printing Dynpro data
Header for Dynpro
FORMAT COLOR COL_TOTAL.
WRITE: / 'Dynpro header', AT sy-linsz ''.
FORMAT COLOR COL_NORMAL.
WRITE: / 'Program:', 30 hdr-prog, AT sy-linsz '',
/ 'Dynpro:', 30 hdr-dnum, AT sy-linsz '',
/ 'Follow-up dynpro:', 30 hdr-fnum, AT sy-linsz ''.
ULINE.
Print field list
FORMAT COLOR COL_TOTAL.
WRITE: / 'Field list' COLOR COL_TOTAL, AT sy-linsz ''.
FORMAT COLOR COL_HEADING.
WRITE: / 'Field',
25 'Line',
30 'Column',
37 'TYPE',
42 'LOOPTyp',
50 'DDIC',
55 'FormByte', AT sy-linsz ''.
CALL FUNCTION 'RS_SCRP_FIELDS_RAW_TO_CHAR'
TABLES
fields_int = fld
fields_char = fields_char
EXCEPTIONS
OTHERS = 1.
FORMAT COLOR COL_NORMAL.
LOOP AT fields_char.
WRITE: /(24) fields_char-feldname,
25 fields_char-line,
30 fields_char-coln,
37 fields_char-feldformat,
42 fields_char-looptype,
50 fields_char-inttyp,
55 fields_char-fmb1,
58 fields_char-fmb2.
ENDLOOP.
ULINE.
Display logic
FORMAT COLOR COL_TOTAL.
WRITE: / 'Logic', AT sy-linsz ''.
FORMAT COLOR COL_NORMAL.
LOOP AT src.
WRITE: / src-line.
ENDLOOP.
ULINE.
SKIP.
Display matchcode data
FORMAT COLOR COL_TOTAL.
WRITE: / 'Matchcode data', AT sy-linsz ''.
FORMAT COLOR COL_NORMAL.
LOOP AT mat.
WRITE: /(80) mat.
ENDLOOP.
IF sy-subrc NE 0.
WRITE / ' no matchcode files available ' COLOR COL_NEGATIVE.
ENDIF.
NEW-PAGE.
ENDFORM. " SHOW_DYN
*& Form SHOW_REP
FORM show_rep.
FORMAT COLOR COL_TOTAL.
WRITE: / 'Program:', reports, AT sy-linsz ''.
FORMAT COLOR COL_BACKGROUND.
LOOP AT i_repsrc.
WRITE: / i_repsrc.
ENDLOOP.
ULINE.
FORMAT COLOR COL_TOTAL.
WRITE: / 'Text elements for program:', reports, AT sy-linsz ''.
FORMAT COLOR COL_HEADING.
WRITE: / 'Type',
5 'Key',
20 'Length',
30 'Text', AT sy-linsz ''.
FORMAT COLOR COL_NORMAL.
LOOP AT i_reptxt.
WRITE: / i_reptxt-id,
5 i_reptxt-key,
20(4) i_reptxt-length,
30(80) i_reptxt-entry.
ENDLOOP.
NEW-PAGE.
ENDFORM. " SHOW_REP
*& Form SHOW_INC
FORM show_inc.
FORMAT COLOR COL_TOTAL.
WRITE: / 'Include:', i_inc, AT sy-linsz ''.
FORMAT COLOR COL_BACKGROUND.
LOOP AT i_repsrc.
WRITE: / i_repsrc.
ENDLOOP.
ULINE.
FORMAT COLOR COL_TOTAL.
WRITE: / 'Text elements for include:', i_inc, AT sy-linsz ''.
FORMAT COLOR COL_HEADING.
WRITE: / 'Type',
5 'Key',
20 'Length',
30 'Text', AT sy-linsz ''.
FORMAT COLOR COL_NORMAL.
LOOP AT i_reptxt.
WRITE: / i_reptxt-id,
5 i_reptxt-key,
20(4) i_reptxt-length,
30(80) i_reptxt-entry.
ENDLOOP.
NEW-PAGE.
ENDFORM. " SHOW_INC
*& Form DYNPRO_DOWNLOAD
& -
Custom Module Pool...
Hello SDN ABAP Community,
I researched this question on the web and in SDN before posting this because I would like an up-to-date understanding of best way to do this.
I have a need to write a custom module pool. It has been a while since I have been to class. I need to get figured out how my naming conventions will work for all the pieces of the module pool (SE51, SE41, pieces of the SE38 module pool).
I seem to remember the teacher saying that the way that SAP allows for customer created module pools was to set the 5th character of the name to 'Z'. eg- sap would use SAPMPetc. customer would use SAPMZetc.
From my searching of web I found following naming standards...
Module pool - SAPDY* SAPDZ*
Module pool for dialog - DY* DZ*
INCLUDES - SAPMY* SAPMZ*
Module pool for screens - MY* MZ*
INCLUDES - MP9*
Module pool for info types - MP9*
INCLUDES - SAPFY* SAPFZ*
Module pool for subroutines - FY* FZ*
INCLUDES - SAPUY* SAPUZ*
Module pool for update program - UY* UZ*
INCLUDES
From searching SDN I found following link for ABAP objects, but I am needing for module pool.
http://help.sap.com/saphelp_nw04/helpdata/en/92/c2b084bc1d11d2958700a0c94260a5/frameset.htm
So my question... is there any SAP resource that I can look at to see SAP naming conventions for customer created module pool with SE41, SE51 and SE38?
Thank you,
Dean Atteberry.Hi Dean, here you can take a look at SAP´s official customer name ranges for all objects, including Module Pool: http://help.sap.com/saphelp_nw04/helpdata/EN/2a/6b0b1f547a11d189600000e829fbbd/frameset.htm
Best regards,
Federico Alvarez -
Module Pool with select options
Hi,
I have created select-option and radio button in Module pool. My req is that I when the user enters any value and click on the radio button the respective programs should be executed.
Thanks
HariHi Hariharan,
I would recommend you to use primarily use push button and then after SUBMIT statement, and also the example for the same is provided below:
*Code used to execute a report
SUBMIT Zreport.
*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'.
* load each personnel number accessed from the structure into
* parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen.
*Code used to populate 'parameters' & execute report
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'.
Please validate the same at your end as well, please come back, if inputs are required.
BR/Thanks
Pranav Agrawal -
Hi friends,
This issue regarding Module Pool Error Handling
How to handle the multiple error on the same screen ,
For example in the below code you could see "Carrid is Invalid" when carrid is entred wrongly
"in the same way i also need " Connid is invalid" When the customer entres the wrong Connid
*Select single * from sflight into e_sflight*
where carrid = e_sflight-carrid AND
connid = e_sflight-connid AND
fldate = e_sflight-fldate.
IF NOT sy-subrc IS INITIAL.
MESSAGE ID 'ZADT' TYPE 'E'
NUMBER '002' WITH 'Carrid is invalid'.
Kindly let me know your feedback\
Thank you
SandyHi Sandy,
in PAI. " Also try to close your Questions as currently 8 out of 8 are unresolved
Chain. " For More info take F1 help on this Key word
field : carrid, connid. " These are the Screen Field names
module validate on chain-request.
endchain.
in Program.
module validate.
select single carrid into carrid
from scarr
where carrid = carrid.
if sy-subrc = 0.
select single connid into connid
from sflight
where connid = connid,
if sy-subrc NE 0.
message 'Enter Valid Connid' type 'E'.
endif.
else.
message 'Enter Valid Carrid' type 'E'.
endif.
endmodule.
Cheerz
Ram
Edited by: Ramchander Krishnamraju on Apr 12, 2010 11:48 AM -
How to call module pool through interactive ALV
Moderator message: do not post in ALL CAPITALS.
Hi all,
I want to create an interactive report in which some parameters on selection-screen when i fill those & press f8 then an alv list is generated from ddic and when user double click on any row then a tcode get call which call a module pool program how can i do so please help me for that
Ketan pande
Abap consultant.
Edited by: Matt on Feb 13, 2009 1:33 PM - Switched to sentence case
Edited by: Matt on Feb 13, 2009 1:34 PMModify this code to add Hot spots or double click action.
This code will dynamically list the data of any DB table.
REPORT yptc_dynamic_alv_table_display .
TABLES: dd02t.
TYPE-POOLS: slis. " ALV Global Types*data declaration for dynamic
* internal table and alv
DATA: l_structure TYPE REF TO data,
l_table TYPE REF TO data,
struc_desc TYPE REF TO cl_abap_structdescr,
lt_layout TYPE slis_layout_alv,
ls_lvc_fieldcatalogue TYPE lvc_s_fcat,
lt_lvc_fieldcatalogue TYPE lvc_t_fcat,
ls_fieldcatalogue TYPE slis_fieldcat_alv,
lt_fieldcatalogue TYPE slis_t_fieldcat_alv,
g_repid LIKE sy-repid,
g_list_top_of_page TYPE slis_t_listheader,
g_events TYPE slis_t_event,
g_events_ex TYPE slis_t_event_exit.
*field symbols declaration
FIELD-SYMBOLS :
<it_table> TYPE STANDARD TABLE,
<dyn_str> TYPE ANY,
<str_comp> TYPE abap_compdescr.
*declarations for grid title
DATA : t1(30),
t2(10),
t3(50).
*selection screen declaration for table input
PARAMETERS : p_table LIKE dd02l-tabname.
*initialization event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*texts for grid title
t1 = 'Dynamic ALV display for table'.
t2 = p_table. CONCATENATE t1 t2 INTO t3 SEPARATED BY space.
* dynamic creation of a structure
CREATE DATA l_structure TYPE (p_table).
ASSIGN l_structure->* TO <dyn_str>.
* fields structure
struc_desc ?= cl_abap_typedescr=>describe_by_data( <dyn_str> ).
LOOP AT struc_desc->components ASSIGNING <str_comp>.
* build fieldcatalog
ls_lvc_fieldcatalogue-fieldname = <str_comp>-name.
ls_lvc_fieldcatalogue-ref_table = p_table.
APPEND ls_lvc_fieldcatalogue TO lt_lvc_fieldcatalogue.
* build fieldcatalog
ls_fieldcatalogue-fieldname = <str_comp>-name.
ls_fieldcatalogue-ref_tabname = p_table.
APPEND ls_fieldcatalogue TO lt_fieldcatalogue.
ENDLOOP.
* create internal table dynamic
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_lvc_fieldcatalogue
IMPORTING
ep_table = l_table.
ASSIGN l_table->* TO <it_table>.
* read data from the table selected.
SELECT * FROM (p_table)
INTO CORRESPONDING FIELDS OF TABLE <it_table>.
* alv layout
lt_layout-zebra = 'X'.
lt_layout-colwidth_optimize = 'X'.
lt_layout-window_titlebar = t3.
* Events
PERFORM eventtab_build USING g_events[]
g_events_ex[].
g_repid = sy-repid.
*alv output
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
is_layout = lt_layout
it_fieldcat = lt_fieldcatalogue
it_events = g_events[]
* it_excluding = g_exclude
TABLES
t_outtab = <it_table>
EXCEPTIONS
program_error = 1
OTHERS = 2.
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.
* FORM eventtab_build *
FORM eventtab_build
USING e03_lt_events TYPE slis_t_event
e03_lt_events_ex TYPE slis_t_event_exit.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
gc_formname_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
DATA: ls_event TYPE slis_alv_event,
ls_event_exit LIKE LINE OF e03_lt_events_ex.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = e03_lt_events.
READ TABLE e03_lt_events
WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO e03_lt_events.
ENDIF.
ENDFORM. " build_events_table
* FORM top_of_page *
FORM top_of_page.
DATA: ls_line TYPE slis_listheader.
SELECT SINGLE * FROM dd02t
WHERE tabname = p_table
AND ddlanguage = sy-langu.
CLEAR g_list_top_of_page[].
CLEAR ls_line.
ls_line-typ = 'H'.
CONCATENATE p_table '-' dd02t-ddtext INTO ls_line-info
SEPARATED BY space.
* ls_line-info = p_table.
APPEND ls_line TO g_list_top_of_page.
PERFORM build_sub_headings
USING g_list_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = g_list_top_of_page[].
ENDFORM. " top_of_page
* FORM build_sub_headings *
* --> E07_TOP_OF_PAGE *
FORM build_sub_headings
USING e07_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = 'Run Info'.
CONCATENATE sy-sysid sy-uname sy-mandt
INTO ls_line-info
SEPARATED BY space.
APPEND ls_line TO e07_top_of_page.
ENDFORM. "build_sub_headings -
Module Pool - Refresh Screen Fields Progmatically
Hello All!
I have a slightly frustrating problem. I have built a Module Pool application to display shipments and their underlying deliveries (various information from each).
I have structured the application as follows
An object to store the Data. This object has an internal table of Shipments and an internal table of Deliveries. The tables are related by TKNUM. When the application needs to display a shipment, it requests the shipment's information and the underlying deliveries information from the object. The object is structured to move through the shipments with methods like "GetFirstHeader", "GetPrevHeader", "GetNextHeader", "GetLastHeader". These return the data for the application to use.
The Deliveries are displayed in a CL_SALV_TABLE, the Shipment information is displayed in textbox type fields above the table.
The form for display has buttons to trigger the "Move" methods of the data object. This currently will retrieve the new data from the object, modify the fields and the alv grid and then go back through PBO (I'm assuming because a button was pressed). This works well. It will bring in the new data and refresh the screen everything is fine.
I also have a button to print the currently displayed Shipment and Deliveries. This Print is handled through a SmartForm.
The area that is giving me troubles is my other button. Since the Application can store a range of shipments at once, I have a "Print All" button. This button moves to the first shipment in the data object,
calls the Print Form, then moves through the rest of the data object calling the Print Form for each Shipment Displayed. This happens from one button push. The problem I am running into is that the screen does not refresh when the data changes during this movement through the data objects. I believe this is due to the PBO module not being triggered yet. My question is, is there a way to refresh the screen progmatically?
I have tried SET USER-COMMAND to move through the data, instead of calling the "GetFirstHeader" and "GetNextHeader" method directly, but that has some unpredictable behavior (works in debug, not in regular execution). I have also tried a LEAVE SCREEN statement, as that would trigger the PBO, since the Next Screen is set to the same screen number, but that kills execution of that block of code at the LEAVE SCREEN STATEMENT.
I am including my code from my PAI module that runs this processing, hopefully that will help.
<< unformatable code removed >>
Moderator message - Please go through your code and post only what is relevant to your question.
Edited by: Rob Burbank on Apr 28, 2009 1:44 PMMODULE USER_COMMAND_9999 INPUT .
CASE OK_CODE .
WHEN 'NEXT' .
PERFORM Next .
PERFORM GetGridData .
PERFORM RefreshALV .
WHEN 'PREV' .
PERFORM Prev .
PERFORM GetGridData .
PERFORM RefreshALV .
WHEN 'EXIT' .
SET SCREEN 0 .
WHEN 'PRNT' .
PERFORM Print .
WHEN 'PRNA' .
PERFORM PrintAll .
WHEN 'BACK' .
PERFORM HideInitials .
SET SCREEN '1000' .
WHEN 'CANC' .
SET SCREEN '1000' .
WHEN 'FRST' .
PERFORM First .
PERFORM GetGridData .
PERFORM RefreshALV .
WHEN 'LAST' .
PERFORM Last .
PERFORM GetGridData .
PERFORM RefreshALV .
WHEN 'CFAX' .
PERFORM Show6000 .
ENDCASE .
ENDMODULE .
FORM PrintAll .
DATA sPromptB TYPE STRING .
DATA sPromptM TYPE STRING .
DATA sPromptE TYPE STRING .
DATA sPromptF TYPE STRING .
DATA cAnswer TYPE C LENGTH 1 .
IF NOT oLTend->isEmpty( ) = 1 .
sPromptB = text-995 .
sPromptM = ITOTSHIPNUM .
sPromptE = text-994 .
CONCATENATE sPromptB sPromptM sPromptE INTO sPromptF SEPARATED BY SPACE .
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Print All?'
TEXT_QUESTION = sPromptF
DISPLAY_CANCEL_BUTTON = ' '
IMPORTING
ANSWER = cAnswer
EXCEPTIONS
TEXT_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 .
IF cAnswer = '1' .
PERFORM First .
PERFORM GetGridData .
PERFORM RefreshALV .
" >>> Need Screen Refreshed right here
PERFORM Print .
DO .
PERFORM Next .
PERFORM GetGridData .
PERFORM RefreshALV .
" >>> Need Screen Refreshed right here
PERFORM Print .
IF oLTend->GetIndex( ) = oLTend->GetCount( ) .
EXIT .
ENDIF .
ENDDO .
ENDIF .
ENDIF .
ENDFORM .
That is the general flow. Hope that helps, if more info is needed, let me know.
Maybe you are looking for
-
While assigning PDF in APP Spool not getting generated
Hi, am working on APP(Automatic Payment Program)...for both cheque printing and Payment Advice printing..Am Using Script for Cheque Printing and PDF forms for Payment Advice Printing... But after running F110, spool is getting generated only for Che
-
Why can't itunes locate my music files when they are there?
I think that this happened when I checked off both "keep iTunes media folder organized" and "copy files to iTunes Media Folder when adding to library."I had all of my files located at C:\Users\Beata\Music\iTunes\iTunes Media and then I noticed that
-
For example: Combo box choices: apple tomato squash Pumpkin The text box depending on the selection above would state the color: Green (if Apple was chosen from the combo box Red (if Tomato was chosen from the combo box Yellow
-
Report Server Error REP-1:
Hi, I am trying to run a oracle report from an oracle form. The very first time when I try to run the report, I get a peculiar error, the report server just says: Error REP-1: . Nothing specific. From the second time onwards its working perfect. Not
-
...... Strange Issue sqldr and JOIN
Hi all i am facing a strange problem I have a table in which i had to relaod data from an excel file due to some reasons the previous data was unloaded. I loaded the dta and tested, and it was all ok. The data is loaded in a child table and checked ,