Selection screen refresh
HI,
my question here is related to selection screen refresh.
in the program one parameter is defined like below.
PARAMETERS :P_EINT LIKE YFR1FIT_SALE_REF-POST_CODE DEFAULT 'EINT' OBLIGATORY VALUE CHECK.
In the table YFR1FIT_SALE_REF table the field POST_CODE the values were maintained at domain level. So, when i selected the F4 help on this field, all the domain values are appearing in the pop-up and also the validation of the data.
Now i have changed that, instead of domain, i have given the check table for this field. Though i did this change at table level, it looks these changes are not reflecting in the program. The program still showing the values maintained at the domain level, but not from the check table.
When i went to SE51 and given this program and 1000 as screen no, i noticed that the flow logic is not updated as per the latest changes. its still refering to the domain level values for validation..
So, to overcome this problem, it looks i have to update the flow logic of the screen 1000, which is created by default. Do you have any idea on how to correct this or refreshing the flow logic for the screen 1000.
Thanks for your time.
Regards,
Srikanth
As per [Input Help Hierarchy in the ABAP Dictionary|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa5435c111d1829f0000e829fbfe/content.htm] Check Table should have overridden the Domain Values in search help.
Please try to activate the screen 1000 (you can go through SE80) once again. Ihave faced such problem earlier.
But even if the problem persists check if you need to insert TABLES statement.. just dicing a though if it works.
You can paste the code also.
Similar Messages
-
Hi,
I created a copy of the transaction LSO_RHXBUCH0. I noticed that if I select a few radio buttons/check boxes and then F4 on a select-option (e.g Participant) all the settings I checked revert back to the original.
Can't see why so looked at the standard transaction LSO_RHXBUCH0 and the same thing happens there.....
1. change Reporting Period, Selection Options and Standard Selection Screen.
2. F4 on Participant
3. select a person
4. press return
All values back to defaults.
Can't find anything on OSS about it - any ideas?
Thanks.Hi,
thanks.
I figured out the issue.
The macro <i>rhx-f4-objid-low</i> has two lines at the end of it which re-initialise the screen:
set screen sy-dynnr.
leave screen.
I created a z-version of the macro with these lines commented out and it worked fine. Logged an OSS message to see if SAP want to fix it.
I will leave this thread open for a little while. If SAP create a note, I'll post the number. Not too optimistic about it but I may be surprised.
Thanks. -
How to refresh value in selection screen field
Hi Experts,
I have a requirement to refresh the value in selection screen.while i run the report in selection screen i selecting one variant for look the output if i use some other field value with same variant without save its working fine i am avle to see the data but while i come back to again selection screen and selecting some other variant that extra add value is not getting refresh its showing with new variant.Its happening for only one variant not for all if i select some other variant then its getting refresh value in same field.Any one can help me for this issue.
Thanks.Hi,
That means, I believe - the value that is "not changing" is saved in the particular variant. You can easily verify it by starting the report without variant and then selecting the variant in question. Remove the value from screen and save the variant again. Don't forget to check of variant needs to be transported from development system...
cheers
Janis -
Macro not working in BEx Analyzer (Refresh selection Screen)
Hi All,
We have migrated work book for 3.x to 7.x and work book having lot of macros calculated and using multiple quires in single work books for inpt selection screen written Macro same macro is not working after Migration to 7.x
7.X Macro code below..
Sub BW_Prod_Year_Summary()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("E9")
End Sub
Sub BW_Prod_Year_Summary_Period()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("G9")
End Sub
Sub BW_Query_for_YTD_and_Monthly_View()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("J9")
End Sub
Sub BW_Prod_Perform_prev_month()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("M9")
End Sub
Sub BW_Prod_Perform_prev_month_Detail()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("P9")
End Sub
Sub BW_3_Months_Volume_Comparison()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("S9")
End Sub
Sub BW_Query_for_Current_RE()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("E40")
End Sub
Sub BW_Query_for_Previous_RE()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("G40")
End Sub
Sub BW_Query_for_Business_Plan_this_year()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("J40")
End Sub
Sub BW_Query_for_Actuals_last_year()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("M40")
End Sub
Sub BW_Query_for_Forecast_next_year()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("P40")
End Sub
Sub BW_Query_for_Forecast_Accuracy()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("S40")
End Sub
Sub BW_PDR()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("E132")
End Sub
Sub BW_SDR()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("G132")
End Sub
Sub BW_TDQ()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("J132")
End Sub
Sub BW_SSDR()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("M132")
End Sub
Sub BW_DDR()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("P132")
End Sub
Sub BW_Blocked_Stock()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("E195")
End Sub
Sub BW_Age_of_Stock()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("G195")
End Sub
Sub BW_Historical_WOS()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("J195")
End Sub
Sub BW_Current_WOS()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("M195")
End Sub
Sub BW_Current_WOS_Details()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("P195")
End Sub
Sub BW_Historical_STO()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("E243")
End Sub
Sub BW_Future_STO()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("G243")
End Sub
Sub BW_Product_Groups()
Run "BExAnalyzer.xla!SAPBEXrefresh", False, Range("J243")
End Sub
Please help me on this..!!
Thanks
PrakashAglukas,
Thanks again. I understand the name of the Macro can be anything and this is how to create the Macro:
1) Run workbook, the query result display on the screen.
2) In Excel 2007, I click on Developer tab ->Macro.
3) Enter Macro name (Macro1) and click on Create button.
4) I have VB editor open with following:
Sub Macro1()
End Sub
5) So added the following code to Macro routine in VBA Module:
Sub Macro1()
With ThisWorkbook.Sheets("Sheet1")
Stop
.Activate
.Cells(15, 1).Interior.Color = RGB(220, 254, 250)
End With
End Sub
6) I then added the Macro1 to Workbook Setting ->Exit tab, and click on Add Macro button.
When I run/refresh the workbook, I didn't get into debug mode at all!!!
What is wrong in above steps?
Please advice, thanks. -
Selection Screen getting refreshed after execution..
Hello All,
I have a strange problem..
My selection-screen values are getting refreshed after execution and come back to selection screen. I am using normal ALV Fm to display the values. Can some suggest a possible reason?
Many thanks,
V NairNo .. I have checked it..Selection variables are not getting refreshed.
My Code Below
REPORT yhr_icm_exception_report.
Type Pool declarations
TYPE-POOLS: slis, "For AlV
sdydo, "Dynamic Documents
icon. "For ICON
Table declarations
TABLES : yhr_icm_exp_log, "ICM Exceptions Log
yhr_icm_exp_hist. "ICM Exception History
Include Constants
INCLUDE yhr_icm_constants . "Program to hold constants
Types declarations
*-To hold return field
TYPES: BEGIN OF ty_returntab.
INCLUDE STRUCTURE ddshretval. "Interface Structure
TYPES: END OF ty_returntab.
*-To hold deletion records
TYPES : BEGIN OF ty_icm_del,
tab_name TYPE yhr_tabname, "Internal table name
objid TYPE hrobjid, "Object ID
begda TYPE begda, "Begin Date
otype TYPE otype, "Object Type
END OF ty_icm_del.
*-Message details to be displayed
TYPES : BEGIN OF ty_message,
msgnr TYPE msgno, "System message number
text TYPE yhr_icm_exp_log-msgxx, "Message Text
END OF ty_message.
*-To hold exception log
TYPES : BEGIN OF ty_icm_exp_log,
msgno TYPE msgnr, "Message number
run_id TYPE yhr_icm_erun_id, "Exception Run ID
delta_id TYPE yhr_icm_run_id, "Run ID
record_type TYPE yhr_icm_exp_type, "Record Type
otype TYPE yhr_otype, "Object Type
objid TYPE hrobjid, "Object ID
begda TYPE begda, "Begin Date
msgxx TYPE msgxx, "Message
status TYPE yhr_icm_icon, "Status
delta_relevance TYPE yhr_delta_rel, "Delta Relevance
END OF ty_icm_exp_log.
*-To hold email attachment
TYPES: BEGIN OF ty_attach,
text(500) TYPE c, "Text
END OF ty_attach.
*To hold object type & text
TYPES :BEGIN OF ty_objid_text,
objid TYPE objid, "Object ID
text TYPE emnam, "Object Text
END OF ty_objid_text.
*-To hold counter values - Exp , Del & historical
TYPES :BEGIN OF ty_count,
exp(10) TYPE c, "Exceptions
del(10) TYPE c, "Deletions
hist(10) TYPE c, "Historical Deletions
END OF ty_count.
*- To hold lock details
TYPES : BEGIN OF ty_lock,
live TYPE c, "Live Callidus Program
genr TYPE c, "Generation Program
exp TYPE c, "Exception Program
END OF ty_lock.
Range Declarations
RANGES :
gr_objid FOR hrp1001-objid, "Range for Object ID
gr_pernr FOR pa0000-pernr. "Range for Employee number
Internal Table Declarations
DATA : gt_records TYPE STANDARD TABLE OF yhr_icm_exp_report,
gt_objid_text TYPE STANDARD TABLE OF ty_objid_text,
gt_icm_exp_log TYPE STANDARD TABLE OF ty_icm_exp_log,
gt_returntab TYPE STANDARD TABLE OF ty_returntab,
gt_t777o TYPE STANDARD TABLE OF t777o,
gt_diff_tab TYPE STANDARD TABLE OF yhr_icm_diff,
gt_del_tab TYPE STANDARD TABLE OF ty_icm_del, "#EC *
gt_iattach TYPE STANDARD TABLE OF ty_attach,
gt_message TYPE STANDARD TABLE OF ty_message,
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_heading TYPE slis_t_listheader,
gt_exceptions TYPE yhr_icm_exp_list_t,
gt_events TYPE slis_t_event.
Structure Declarations
DATA : gs_objid_text TYPE ty_objid_text,
gs_icm_exp_log TYPE ty_icm_exp_log,
gs_records TYPE yhr_icm_exp_report,
gs_exceptions TYPE yhr_icm_exp_list,
gs_count TYPE ty_count,
gs_fieldcat TYPE slis_fieldcat_alv, "#EC *
gs_returntab TYPE ty_returntab,
gs_icm_exp_hist TYPE yhr_icm_exp_hist,
gs_iattach TYPE ty_attach,
gs_message TYPE ty_message, "#EC *
gs_layout TYPE slis_layout_alv,
gs_t777o TYPE t777o,
gs_lock TYPE ty_lock.
Constant declarations
CONSTANTS:
c_yes TYPE string VALUE 'YES',
c_no TYPE string VALUE 'NO',
c_true TYPE c VALUE 'X',
c_deletions TYPE c VALUE 'D',
c_delta_no TYPE c VALUE 'N',
c_delta_yes TYPE c VALUE 'Y',
c_historical TYPE c VALUE 'H',
c_a TYPE c VALUE 'A',
c_error TYPE c VALUE 'E',
c_equal(2) TYPE c VALUE 'EQ',
c_participants TYPE c VALUE 'P',
c_include TYPE c VALUE 'I',
c_position TYPE c VALUE 'S',
c_organization TYPE c VALUE 'O',
c_runlock TYPE string VALUE 'RUN_LOCK',
c_parameter TYPE string VALUE 'P',
c_selfield TYPE string VALUE 'SEL_FIELD' ,
c_type TYPE string VALUE 'TYPE',
c_topofpage TYPE string VALUE 'TOP_OF_PAGE',
c_rectype TYPE string VALUE ' S_RECTYPE',
c_objectkey TYPE string VALUE 'OBJECTKEY1',
c_icon_green TYPE string VALUE '@08@',
c_icon_red TYPE string VALUE '@0A@',
c_icon_amber TYPE string VALUE '@09@',
c_green TYPE string VALUE 'GREEN',
c_amber TYPE string VALUE 'AMBER',
c_red TYPE string VALUE 'RED',
c_tabname TYPE slis_tabname VALUE 'GT_RECORDS',
c_structname TYPE dd02l-tabname VALUE 'YHR_ICM_EXP_REPORT' ,
c_siwb_wallpaper TYPE sdydo_key VALUE 'SIWB_WALLPAPER',
c_user_command TYPE slis_formname VALUE 'F01_ALV_EVENT_USER_COMMAND',
c_genname TYPE trdir-name VALUE 'YHR_ICM_GENERATE_EXCEPTIONS',
c_expname TYPE trdir-name VALUE 'YHR_ICM_EXCEPTION_REPORT',
c_pf_status TYPE slis_formname VALUE 'SET_PF_STATUS',
c_msg_class TYPE string VALUE 'YHR_ICM'.
Global Variable Declarations
DATA: gv_email_error TYPE c,
gv_email_sent TYPE c,
gv_exit TYPE c.
Selection Screen - Block I
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-s07.
SELECT-OPTIONS:
*- Run ID
s_run_id FOR yhr_icm_exp_hist-run_id,
*- Exception Type
s_rectyp FOR yhr_icm_exp_log-record_type NO INTERVALS,
*- Object Type
s_otype FOR yhr_icm_exp_log-otype NO INTERVALS,
*- Object ID
s_objid FOR yhr_icm_exp_log-objid NO INTERVALS,
*- Start Date
s_begda FOR yhr_icm_exp_log-begda,
*- Message number
s_msgno FOR yhr_icm_exp_log-msgno,
*- Message Text
s_msgxx FOR yhr_icm_exp_log-msgxx.
SELECT-OPTIONS:
*- Delta Relevance
s_relv FOR yhr_icm_exp_log-delta_relevance NO INTERVALS.
PARAMETERS:
*- Long Text
p_ltext AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN: END OF BLOCK b3.
Selection Screen - Block II
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-s08.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(14) text-033.
*-Sucess
PARAMETERS:
p_stat_s AS CHECKBOX. "D11K917251
SELECTION-SCREEN COMMENT 24(14) text-034.
*-Warning
PARAMETERS:
p_stat_w AS CHECKBOX. "D11K917251
SELECTION-SCREEN COMMENT 48(15) text-035.
PARAMETERS:
*-Error
p_stat_e AS CHECKBOX . "D11K917251
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK b2.
Selection Screen - Block III
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-s09.
*-Email Details
PARAMETERS:
p_email(128) TYPE c.
SELECTION-SCREEN: END OF BLOCK b4.
Selection Screen on value request.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_msgno-low.
PERFORM f4_message.
Selection Screen Output.
AT SELECTION-SCREEN OUTPUT.
CHECK gt_returntab[] IS NOT INITIAL.
REFRESH s_msgno.
s_msgno-option = c_equal.
s_msgno-sign = c_include.
LOOP AT gt_returntab INTO gs_returntab.
s_msgno-low = gs_returntab-fieldval.
s_msgno-high = space.
APPEND s_msgno.
ENDLOOP.
At Selection Screen for Validation
AT SELECTION-SCREEN.
CLEAR gv_email_error.
*-Validate Object Type
PERFORM validate_objecttype.
*-Validate Exception ID
PERFORM fetch_exp_header.
*-Validate Exception Type
PERFORM validate_exptype.
*-Validate Message Number
PERFORM validate_msgno.
*-Validate Message Type
PERFORM validate_msgtype.
*-Validate Delta
PERFORM validate_delta.
*-Validate Email ID
PERFORM validate_email USING p_email
CHANGING gv_email_error.
IF gv_email_error IS NOT INITIAL.
MESSAGE e000(yhr_icm) WITH text-027.
ENDIF.
Initialization
INITIALIZATION.
Initialization
PERFORM initialization.
Start Of Selection
START-OF-SELECTION.
CLEAR : gv_email_error,
gv_email_sent,
gv_exit,
gs_lock.
Try locking the main program
PERFORM lock_generation_program.
CHECK gs_lock IS INITIAL.
*-Fetch the messages stored in table
PERFORM fetch_item_records.
Read object type text.
PERFORM read_text.
Get Object Text
PERFORM get_object_text.
*-Fetch the current SAP messages
PERFORM fetch_records.
*-Update Delta Flag
PERFORM update_delta_flag.
*-Compare messages in table & in SAP
PERFORM compare_message.
If receiver is not blank, try sending out mail
PERFORM send_mail USING p_email.
End Of Selection
END-OF-SELECTION.
IF gv_exit IS NOT INITIAL.
EXIT.
ENDIF.
*-Display ALV
PERFORM display_alv.
*-Build the event table for ALV display
PERFORM build_eventtab CHANGING gt_events[].
*-Fill the layout details
PERFORM layout_build .
Release all locks
PERFORM release_locks.
*-Finally call the grid display
PERFORM display_data.
*& Form set_pf_status
text
-->RT_EXTAB text
FORM set_pf_status USING rt_extab TYPE slis_t_extab. "#EC *
Set PF Status
SET PF-STATUS 'STANDARD'.
ENDFORM. "Set_pf_status
*& Form DISPLAY_ALV
text
--> p1 text
<-- p2 text
FORM display_alv .
*- Use FM to create field catalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = c_tabname
i_structure_name = c_structname
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 1
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-001.
EXIT.
ENDIF.
*- Remove SEL Field Column as it is not required
DELETE gt_fieldcat WHERE fieldname = c_selfield.
*-If user chooses long text, activate icon
IF p_ltext IS INITIAL.
LOOP AT gt_fieldcat INTO gs_fieldcat WHERE fieldname = c_type.
gs_fieldcat-icon = c_true.
ENDLOOP.
ENDIF.
ENDFORM. " DISPLAY_ALV
*& Form BUILD_EVENTTAB
text
<--P_GT_EVENTS[] text
FORM build_eventtab CHANGING p_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
*-Get the list of event for alv
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_events.
*-Add top of page event to event list
READ TABLE p_events
WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE c_topofpage TO ls_event-form.
APPEND ls_event TO p_events.
ENDIF.
ENDFORM. " BUILD_EVENTTAB
*& Form LAYOUT_BUILD
text
--> p1 text
<-- p2 text
FORM layout_build .
gs_layout-zebra = c_true.
gs_layout-colwidth_optimize = c_true.
gs_layout-detail_popup = c_true.
gs_layout-detail_initial_lines = c_true.
gs_layout-detail_titlebar = text-044.
gs_layout-box_fieldname = c_selfield.
ENDFORM. " LAYOUT_BUILD
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
*-Display ALV display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_user_command = c_user_command
i_background_id = c_siwb_wallpaper
i_callback_program = sy-repid
i_callback_pf_status_set = c_pf_status
i_default = c_true
i_save = c_a
is_layout = gs_layout
it_fieldcat = gt_fieldcat
it_events = gt_events
TABLES
t_outtab = gt_records.
ENDFORM. " DISPLAY_DATA
*& Form FETCH_RECORDS
text
--> p1 text
<-- p2 text
FORM fetch_records .
REFRESH : gt_diff_tab,
gt_del_tab,
gr_pernr,
gt_exceptions.
CLEAR: gs_icm_exp_log.
*-Get Employee details
PERFORM get_person_data.
*-Get Position Details
PERFORM get_position_data.
*-Get Organization Details
PERFORM get_org_data.
*-Get Exception current SAP exception list.
PERFORM get_exception_list.
*-Add deletion records
PERFORM filter_deletions.
ENDFORM. " FETCH_RECORDS
*& Form top_of_page
text
FORM top_of_page. "#EC *
PERFORM build_comment USING gt_heading.
*-Display Use FM to display Top Of Page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_heading[].
CLEAR gt_heading.
ENDFORM. "TOP_OF_PAGE
*& Form build_comment
text
-->P_HEADING text
FORM build_comment USING p_heading TYPE slis_t_listheader.
DATA: ls_hline TYPE slis_listheader,
lv_text(120) TYPE c.
*-Display report title
ls_hline-typ = c_historical.
WRITE text-006 TO lv_text.
ls_hline-info = lv_text.
APPEND ls_hline TO p_heading.
CLEAR ls_hline.
ls_hline-typ = c_s.
*-Remove leading & trailing spaces
CONDENSE : gs_count-del, gs_count-exp, gs_count-hist.
*-If the count is space then pass 0
IF gs_count-del = space.
gs_count-del = 0.
ENDIF.
IF gs_count-exp = space.
gs_count-exp = 0.
ENDIF.
IF gs_count-hist = space.
gs_count-hist = 0.
ENDIF.
IF gs_lock IS INITIAL.
*-Display Deletion, Exception, Historical Count
CONCATENATE text-037 gs_count-del
text-032 gs_count-exp
text-039 gs_count-hist
INTO ls_hline-info SEPARATED BY space.
ELSEIF gs_lock-live IS NOT INITIAL.
ls_hline-info = text-007.
ELSEIF gs_lock-genr IS NOT INITIAL.
ls_hline-info = text-008.
ELSEIF gs_lock-exp IS NOT INITIAL.
ls_hline-info = text-009.
ENDIF.
APPEND ls_hline TO p_heading.
CLEAR ls_hline.
ENDFORM. "BUILD_COMMENT
*& Form INITIALIZATION
text
--> p1 text
<-- p2 text
FORM initialization .
Read Previous run
SELECT MAX( run_id )
INTO s_run_id-low
FROM yhr_icm_exp_hist. "#EC *
s_run_id-option = c_equal.
s_run_id-sign = c_include.
APPEND s_run_id.
s_rectyp-option = c_equal.
s_rectyp-sign = c_include.
s_rectyp-low = c_error.
APPEND s_rectyp.
s_rectyp-low = c_deletions.
APPEND s_rectyp.
PERFORM restrict_selections.
*Get the message from Message Class YHR_ICM
SELECT msgnr
text
FROM t100
INTO TABLE gt_message
WHERE arbgb = c_msg_class AND
msgnr GT '000'. "#EC *
ENDFORM. " INITIALIZATION
*& Form F4_MESSAGE
text
<--P_P_MSGNO text
FORM f4_message.
F4 Help - Display all messages
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MSGNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'S_MSGNR'
window_title = text-045
value_org = c_s
multiple_choice = c_true
TABLES
value_tab = gt_message
return_tab = gt_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-002.
EXIT.
ELSEIF sy-subrc = 2.
MESSAGE i000(yhr_icm) WITH text-003.
EXIT.
ENDIF.
ENDFORM. " F4_MESSAGE
*& Form VALIDATE_OBJECTTYPE
text
--> p1 text
<-- p2 text
FORM validate_objecttype .
CHECK s_otype-low IS NOT INITIAL.
CONDENSE s_otype-low.
Validate object type to check whether user has entered only S, P or O
IF s_otype-low NE c_organization AND
s_otype-low NE c_position AND
s_otype-low NE c_participants .
MESSAGE e000(yhr_icm) WITH 'Enter either S(Position), P(Person) or O(Org Unit)'(021).
ENDIF.
ENDFORM. " VALIDATE_OBJECTTYPE
*& Form VALIDATE_OBJECTTYPE
FORM f01_alv_event_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield."#EC *
DATA : lv_answer TYPE c,
lt_fields TYPE STANDARD TABLE OF sval,
ls_fields TYPE sval.
*-Get the row user has selected in ALV list
READ TABLE gt_records INTO gs_records INDEX rs_selfield-tabindex.
CASE r_ucomm.
WHEN 'DISP'.
CASE gs_records-otype.
WHEN 'S'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01_DISP' AND SKIP FIRST SCREEN.
WHEN 'P'.
SET PARAMETER ID 'PER' FIELD gs_records-objid.
CALL TRANSACTION 'PA20' AND SKIP FIRST SCREEN.
WHEN 'O'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01_DISP' AND SKIP FIRST SCREEN.
ENDCASE.
WHEN 'CHNG'.
CASE gs_records-otype.
WHEN 'S'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01' AND SKIP FIRST SCREEN.
WHEN 'P'.
SET PARAMETER ID 'PER' FIELD gs_records-objid.
CALL TRANSACTION 'PA30' AND SKIP FIRST SCREEN.
WHEN 'O'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01' AND SKIP FIRST SCREEN.
ENDCASE.
WHEN 'EMAIL'.
*- Check whether email has already been sent
IF gv_email_sent = c_true.
*- If yes, then display pop up to confirm for mailing again
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = text-041
text_button_1 = text-042
text_button_2 = text-043
IMPORTING
answer = lv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-004.
EXIT.
ENDIF.
*- Continue only if user has selected Yes
CHECK lv_answer = '1'.
ENDIF.
*- Add Email Field & Table
ls_fields-tabname = 'SZA5_D0700'.
ls_fields-fieldname = 'SMTP_ADDR'.
APPEND ls_fields TO lt_fields.
*- Use FM to get new Email ID
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
popup_title = text-s09
start_column = '5'
start_row = '5'
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-004.
EXIT.
ENDIF.
*- Get the Email user has entered
READ TABLE lt_fields INTO ls_fields INDEX 1.
*- Validate Email ID
PERFORM validate_email USING ls_fields-value
CHANGING gv_email_error.
*- If the flag is not initial, indicates possible error
IF gv_email_error IS NOT INITIAL.
MESSAGE i000(yhr_icm) WITH text-027.
EXIT.
ELSE.
If no error, then try ending email
PERFORM send_mail USING ls_fields-value.
ENDIF.
WHEN 'REFRESH'.
*- Fetch the current SAP messages
PERFORM fetch_records.
*- Update Delta Flag
PERFORM update_delta_flag.
*- Compare messages in table & in SAP
PERFORM compare_message.
*- Refresh alv which is already displayed
rs_selfield-refresh = c_true.
ENDCASE.
ENDFORM. "F01_ALV_EVENT_USER_COMMAND
*& Form RESTRICT_SELECTIONS
text
--> p1 text
<-- p2 text
FORM restrict_selections .
TYPE-POOLS sscr.
STATICS: lt_restrict TYPE sscr_restrict,
lt_opt_list TYPE sscr_opt_list,
ls_*** TYPE sscr_***.
Restrict the wage type selection so the user can only enter
values with the 'EQ' clause.
CLEAR lt_opt_list.
MOVE c_objectkey TO lt_opt_list.
MOVE c_true TO: lt_opt_list-options-eq,
lt_opt_list-options-bt,
lt_opt_list-options-cp,
lt_opt_list-options-eq,
lt_opt_list-options-ge,
lt_opt_list-options-gt,
lt_opt_list-options-le,
lt_opt_list-options-lt.
APPEND lt_opt_list TO lt_restrict-opt_list_tab.
MOVE: c_s TO ls_***-kind,
c_rectype TO ls_***-name,
c_include TO ls_***-sg_main,
space TO ls_***-sg_addy,
c_objectkey TO ls_***-op_main.
APPEND ls_*** TO lt_restrict-***_tab.
*-Restrict the values OTYPE
MOVE 'S_OTYPE' TO ls_***-name.
APPEND ls_*** TO lt_restrict-***_tab.
*-Restrict the values OBJID
MOVE 'S_OBJID' TO ls_***-name.
APPEND ls_*** TO lt_restrict-***_tab.
*-Use FM to restrict the values
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = lt_restrict.
ENDFORM. " RESTRICT_SELECTIONS
*& Form GET_PERSON_DATA
text
--> p1 text
<-- p2 text
FORM get_person_data .
DATA : lt_del_tab TYPE STANDARD TABLE OF yhr_icm_diff.
SORT gt_icm_exp_log BY msgno .
gr_pernr-sign = c_include.
gr_pernr-option = c_equal.
LOOP AT gt_icm_exp_log INTO gs_icm_exp_log WHERE otype = c_participants AND
record_type = c_error.
*- Sort the table based on msgno and collect pernr
gr_pernr-sign = c_include.
gr_pernr-option = c_equal.
gr_pernr-low = gs_icm_exp_log-objid.
APPEND gr_pernr.
CLEAR gr_pernr-low.
AT END OF msgno. "#EC *
*- For the list of Pernr having same PERNR get the current exp details
IF gs_icm_exp_log-msgno = c_msg_100.
*- Export the pernr list to memory id & import in the below FM
*- Selection of records should be based on values exported from here
EXPORT gr_pernr TO MEMORY ID 'PERNR_0001'.
Get Org Assignment 0001 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0001_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_101. "Y_HR_DIFF_PERNR_0001_ORG_DATA
ELSEIF gs_icm_exp_log-msgno = c_msg_102 .
EXPORT gr_pernr TO MEMORY ID 'PERNR_0000'.
Get Actions 0000 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0000_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_103.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0002'.
Get Personal Details 0002 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0002_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_104.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0004'.
Get Disability 0004 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0004_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_105.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0006'.
Get Addresses 0006 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0006_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_106.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0007'.
Get Planned Time 0007 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0007_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_107.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0016'.
Get Contract Element 0016 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0016_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_108.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0077'.
Get Additional Personal 0077 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0077_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_109 .
EXPORT gr_pernr TO MEMORY ID 'PERNR_0105'.
Get Communications 0105 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0105_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_110.
EXPORT gr_pernr TO MEMORY ID 'PERNR_2001'.
Get Absences 2001 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_2001_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda -
Hi,
we have a different behaviour by refreshing the selection screen in portal and RSRT since Version 7.
If you selected an optional variable in the portal, run the query and refresh the variables, the optional variable ist deleted.
With RSRT the optional variable is not deleted.
Any idea what the reason is?
An OSS with SAP do not bring a solution since november.
ThanksHi Annette,
SAP offers a facility to personalize the selection screen entries for a particular user for a particular query. Once a query is personalized for a user for a Query, whenever the user executes the query, instead of popping up the selection screen the query get directly executed and reports the result.
In your case, there could be a chance that such a personalization has happened.
After opening bex analyser using T-code rrmx, when you try to execute a query with selection variabels , the selection screen should pop up. If that doesn't happen and the query displays the result directly or displays the message - "no data available " - this means personalization could have happened.
Now when you try to refresh the query output, this should take you to the variable selection screen. There will be an icon at the bottom of the selection screen ( 5th icon from left) " Personalize variables for the query" - if this is clicked by error the variable values entered will get personalized. When such a personalization occurs the smiley against each selection screen entry turn green from blue. If that smiley is yellow , we need to reset the personalization. To reset the personalization, click on the smiley against the variables and select the reset personalization option.
This should help you if an personalization of query variables has happened. -
Need Different Selection screen for different Queries in a Workbook
Hi,
I have created a workbook with Multiple tabs in BI 7.0. Each Tab has different Queries and each query has different Selection screens (Variable Selections).
When i open the workbook and refresh it, the selection screen is appearing only for one query. All the queries are refreshed by this single selection screen, though each query has different Variable selections. What i need is a seperate selection screen i.e seperate Variable selection appearing for each queries, when i refresh each one of them.
Is it possible to do this? If anybody has tried this, help me in solving this issue. Thanks for ur time.
Regards,
MuraliMurali,
If you un-check the 'Display Duplicate Variables Only Once' this WILL solve your problem.
When you Refresh, you should be presented with a single variable selection dialog box, but it should contain an area for each Query (DataProvider) that is embedded in the Workbook.
This is the case if the queries are all on the same tab, or on different tabs.
However, if you have multiple tabs each with a query on it, each query must have it's own DataProvider. If all queries are based on the same DataProvider, it will not work as the Workbook only 'sees' one Query for which it needs variable input.
If you REALLY want multiple variable selection dialog boxes, then maybe the best way to do this is to have the queries in separate Workbooks.
If you don't want the User to have to open 5 queries manually, you could use a Macro in each Workbook that runs on opening, to open the next Workbook in the sequence.
I hope this makes sense!
Regards
Steve -
Need help to disable input selection-screen - very urgent
Hi SAP experts,
I have a requirement where in I need to disable ( Grey out ) the input fileds on the selection screen .
My problem is as I am using ABAP query I am not able to use any events ( AT SELECTION-SCREEN OUTPUT ).
My selection screen looks like this
MATERIAL NUMBER ( SELECT-OPTIONS)
MATERIAL TYPE ( PARAMETERS )
Now I want to add one more check box below the above fields on the selection-screen.When I click on the check-box,the MATERIAL NUMBER must be greyed out and MATERIAL TYPE should remain the same.
Please let me know the coding for the same. All answers would be rewarded.
Thanks in Advance,
Suresh.Hi,
Check out these codes.
1.
TABLES : mara, makt.
parameter: p_matnr type mara-matnr,
p_maktx type makt-maktx.
at selection-screen output.
select single maktx
from makt
into p_maktx
where matnr = p_matnr
and spras = 'EN'.
loop at screen.
if screen-name = 'P_MAKTX'.
screen-input = 0.
modify screen.
endif.
endloop.
2.
TABLES : mara, makt.
TYPES:BEGIN OF tp_maktx,
maktx TYPE makt-maktx,
END OF tp_maktx.
DATA:t_maktx TYPE STANDARD TABLE OF tp_maktx,
wa_maktx TYPE tp_maktx.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_maktx FOR makt-maktx.
INITIALIZATION.
REFRESH s_maktx[].
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'S_MAKTX-LOW' or screen-name = 'S_MAKTX-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
REFRESH s_maktx[].
if s_matnr[] is not initial.
SELECT maktx FROM makt
INTO TABLE t_maktx
WHERE matnr IN s_matnr
AND spras = 'EN'.
endif.
LOOP AT t_maktx INTO wa_maktx.
s_maktx-low = wa_maktx-maktx.
APPEND s_maktx.
CLEAR:wa_maktx.
ENDLOOP.
3.
TABLES : mara, makt.
parameter p_cb1 type c as checkbox.
parameter p_cb2 type c as checkbox.
parameter p_cb3 type c as checkbox.
initialization.
loop at screen.
if screen-name = 'P_CB3'.
screen-invisible = 1.
modify screen.
endif.
endloop.
at selection-screen output.
*loop at screen.
*if screen-name = 'P_CB3'.
*screen-invisible = 1.
*modify screen.
*endif.
*endloop.
loop at screen.
if p_cb1 = 'X'.
if screen-name = 'P_CB2'.
screen-invisible = 1.
modify screen.
endif.
if screen-name = 'P_CB3'.
screen-invisible = 0.
modify screen.
endif.
endif.
if p_cb2 = 'X'.
if screen-name = 'P_CB3'.
screen-invisible = 1.
modify screen.
endif.
if screen-name = 'P_CB1'.
screen-invisible = 0.
modify screen.
endif.
endif.
if p_cb3 = 'X'.
if screen-name = 'P_CB1'.
screen-invisible = 1.
modify screen.
endif.
if screen-name = 'P_CB2'.
screen-invisible = 0.
modify screen.
endif.
endif.
endloop.
Reward if helpful..
Regards. -
From ALV list to Selection-screen
Hi,
I have problem in coming back to selection screen after displaying ALV List.
In ALV list i'm using check box option to delete selected records. After deletion I'm displaying the remaining records with one more call to ALV function module.
As this is not a secondary list i'm not able to use SY-LSIND and even call selection-screen or leave to screen 0 are not working.
could you please help me out.
Thanks,
Vinay.Hi
You don't have to show the remaining records in another ALV.
In the user command sub-routine we will be passing the parameter RS_SELFIELD TYPE SLIS_SELFIELD.
When you delete the rows from the internal table in the user command set the refresh field to on.
RS_SELFIELD-REFRESH = 'X'.
Please let me know if it works.
Thanks,
Naren -
From ALV output list to selection screen
Hi,
I created one ALV report.
After executing the program, it displays an ALV list.
When I click on the back/exit/cancel buttons on the screen, it should take me to the selection screen.
But that is not happening. it is taking to one screen which shows the report heading. IF i click back/cancel/exit buttons in this screen, it is taking me to the selection screen.
I checked the program for any write statement, but therre are no write statements.
Even i tried to remove the end-of-selection event in the program. but not working.
Can any one help me on this how to overcome this issue.
Thank you.
Kumarhi check this example...
REPORT zalv_sel_screen .TABLES: mara.DATA: BEGIN OF i_alv OCCURS 0,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
groes TYPE mara-groes,
maktx TYPE makt-maktx,
END OF i_alv.DATA: alv_container TYPE REF TO cl_gui_docking_container.
DATA: alv_grid TYPE REF TO cl_gui_alv_grid.
DATA: layout TYPE lvc_s_layo.
DATA: fieldcat TYPE lvc_t_fcat.PARAMETERS: p_check.INITIALIZATION. PERFORM get_data.AT SELECTION-SCREEN OUTPUT. DATA: variant TYPE disvariant.
DATA: repid TYPE sy-repid. repid = sy-repid. variant-report = sy-repid.
variant-username = sy-uname. layout-zebra = 'X'.
layout-edit_mode = 'X'. CHECK alv_container IS INITIAL. CREATE OBJECT alv_container
EXPORTING repid = repid
dynnr = sy-dynnr
side = alv_container->dock_at_left
extension = 1500. CREATE OBJECT alv_grid
EXPORTING
i_parent = alv_container.* ALV Specific. Data selection.
Populate Field Catalog
PERFORM get_fieldcatalog. CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = layout
is_variant = variant
i_save = 'U'
i_structure_name = 'I_ALV'
CHANGING
it_outtab = i_alv[]
it_fieldcatalog = fieldcat[].
START-OF-SELECTION.
FORM GET_DATA
FORM get_data. SELECT * INTO CORRESPONDING FIELDS OF TABLE i_alv
FROM mara
INNER JOIN makt
ON maramatnr = maktmatnr
UP TO 100 ROWS
WHERE makt~spras = sy-langu. SORT i_alv ASCENDING BY matnr.ENDFORM. "get_data***************************************************************
Form Get_Fieldcatalog - Set Up Columns/Headers
FORM get_fieldcatalog. DATA: ls_fcat TYPE lvc_s_fcat.
REFRESH: fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Number'.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '18'.
ls_fcat-fix_column = 'X'.
ls_fcat-key = 'X'.
ls_fcat-col_pos = '1'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Type'.
ls_fcat-fieldname = 'MTART'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '10'.
ls_fcat-fix_column = 'X'.
ls_fcat-key = 'X'.
ls_fcat-col_pos = '2'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Group'.
ls_fcat-fieldname = 'MATKL'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '12'.
ls_fcat-col_pos = '3'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Size'.
ls_fcat-fieldname = 'GROES'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '30'. ls_fcat-col_pos = '4'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Description'.
ls_fcat-fieldname = 'MAKTX'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '40'. ls_fcat-col_pos = '5'.
APPEND ls_fcat TO fieldcat.ENDFORM. "get_fieldcatalog
regards,
venkat -
How can I add a new field in selection screen for this report
*& Report ZGS_BARKODLA_HIZLI_GIRIS
report zgs_barkodla_hizli_giris.
tables: mara,
mseg,
mch1,
*mch1,
mkpf,
mchb ,
makt.
type-pools: esp1.
data: i_message_tab type esp1_message_tab_type,
wa_message_tab type esp1_message_wa_type ,
sc_count type i.
ALV
type-pools: slis, kkblo.
data: gs_layout type slis_layout_alv ,
gt_fldcat type slis_t_fieldcat_alv with header line,
gt_header type slis_t_listheader with header line,
gt_sortin type slis_t_sortinfo_alv with header line,
g_repid like sy-repid .
define add-fieldcat.
gt_fldcat-fieldname = &1.
gt_fldcat-ref_tabname = &2.
gt_fldcat-seltext_s = &3.
gt_fldcat-seltext_m = &3.
gt_fldcat-seltext_l = &3.
gt_fldcat-reptext_ddic = &3.
gt_fldcat-ddictxt = 'M'.
append gt_fldcat.
clear gt_fldcat.
end-of-definition.
types: begin of titab,
sel type xfeld,
matnr type matnr,
maktx type maktx,
charg type charg_d,
menge type menge_d,
erfmg type erfmg,
end of titab.
data : witab type titab.
data : itab type table of titab.
data : ok_code type sy-ucomm.
controls: tc_itab type tableview using screen 0100.
data: gv_header like bapi2017_gm_head_01,
gv_code like bapi2017_gm_code.
BAPI export parameters
data: gv_headret type bapi2017_gm_head_ret,
gv_matdoc type bapi2017_gm_head_ret-mat_doc,
gv_matyear type bapi2017_gm_head_ret-doc_year.
data : lv_objek like inob-objek .
data : ls_inob like inob .
data : imseg type ty_t_mseg.
data : wmseg type mseg.
data : answer.
data : count type i.
data : v_atinn type atinn.
BAPI movement details
data: i_goodsmvt_items type bapi2017_gm_item_create occurs 0
with header line.
data: i_return type bapiret2 occurs 0 with header line.
start-of-selection.
call function 'CONVERSION_EXIT_ATINN_INPUT'
exporting
input = 'Z_ORAN'
importing
output = v_atinn.
call screen 100.
*& Module status_0100 OUTPUT
module status_0100 output.
set pf-status '100'.
set titlebar '100'.
mseg-werks = 1000.
mseg-umwrk = 1000.
**added
sc_count = sc_count + 1.
if sc_count eq 1.
mseg-bwart = 313.
endif.
mkpf-budat = sy-datum.
**added
describe table itab lines tc_itab-lines.
endmodule. " status_0100 OUTPUT
*& Module user_command_0100 INPUT
module user_command_0100 input.
data field(20).
data: line_t like sy-index.
data: lines like sy-index.
data line_count like sy-loopc.
data: begin of cols,
screen like screen,
index type i,
selected(1) type c,
vislength like icon-oleng,
invisible(1) type c,
end of cols.
case ok_code.
when 'DELE'.
delete itab where sel eq 'X'.
when 'ENTE'.
check *mch1-charg is not initial.
read table itab into witab with key charg = *mch1-charg.
if not sy-subrc is initial.
witab-charg = *mch1-charg.
select single matnr from mch1 into witab-matnr
where charg eq witab-charg.
if not syst-subrc is initial.
set cursor field '*MCH1-CHARG'.
message e115(12) with *mch1-charg.
endif.
select single maktx from makt into witab-maktx
where matnr eq witab-matnr
and spras eq syst-langu.
witab-erfmg = 1.
concatenate witab-matnr witab-charg into lv_objek .
clear ls_inob .
select single * into ls_inob
from inob
where objek = lv_objek and
klart = '023' and
obtab = 'MCH1' .
select single atflv from ausp into witab-menge
where objek = ls_inob-cuobj and
klart = '023' .
append witab to itab.
**added
clear *mch1-charg.
**added
endif.
when 'SAVE'.
if mkpf-budat is initial.
set cursor field 'MKPF-BUDAT'.
message e055(00).
endif.
if mseg-lgort is initial.
set cursor field 'MSEG-LGORT'.
message e055(00).
endif.
if mseg-umlgo is initial.
set cursor field 'MSEG-UMLGO'.
message e055(00).
endif.
if mseg-bwart is initial.
set cursor field 'MSEG-BWART'.
message e055(00).
endif.
refresh imseg.
loop at itab into witab.
move-corresponding witab to wmseg.
append wmseg to imseg.
endloop.
call function 'ZMM_POPUP_WITH_DATA'
exporting
imseg = imseg
importing
answer = answer.
if answer eq 'Y'.
perform create_goods_movement.
endif.
when 'P--'.
clear ok_code.
perform paging using 'P--'.
set cursor field 'MARA-MATNR' line 1.
when 'P-'.
clear ok_code.
perform paging using 'P-'.
set cursor field 'MARA-MATNR' line 1.
when 'P+'.
clear ok_code.
clear lines.
perform paging using 'P+'.
set cursor field 'MARA-MATNR' line 1.
when 'P++'.
clear ok_code.
perform paging using 'P++'.
set cursor field 'MARA-MATNR' line 1.
when 'SORA'.
read table tc_itab-cols into cols with key selected = 'X'.
if sy-subrc is initial.
field = cols-screen.
field = field+5(10).
sort itab ascending by (field).
endif.
when 'SORZ'.
read table tc_itab-cols into cols with key selected = 'X'.
if sy-subrc is initial.
field = cols-screen.
field = field+5(10).
sort itab descending by (field).
endif.
when 'PRNT'.
perform write_alv.
endcase.
endmodule. " user_command_0100 INPUT
*& Module read_table OUTPUT
module read_table output.
mara-matnr = witab-matnr.
makt-maktx = witab-maktx.
mch1-charg = witab-charg.
mseg-menge = witab-menge.
mseg-erfmg = witab-erfmg.
line_count = sy-loopc.
endmodule. " read_table OUTPUT
*& Module write_table INPUT
module write_table input.
witab-matnr = mara-matnr.
witab-maktx = makt-maktx.
witab-charg = mch1-charg.
witab-menge = mseg-menge.
witab-erfmg = mseg-erfmg.
modify itab from witab index tc_itab-current_line.
endmodule. " write_table INPUT
*& Module exit INPUT
module exit input.
leave to screen 0 .
endmodule. " exit INPUT
*& Form create_goods_movement
form create_goods_movement .
clear : gv_header, i_return[], i_goodsmvt_items[].
gv_header-doc_date = gv_header-pstng_date = mkpf-budat.
gv_header-pr_uname = sy-uname.
GM with reference to reservation
loop at itab into witab.
i_goodsmvt_items-material = witab-matnr.
i_goodsmvt_items-entry_qnt = witab-erfmg.
i_goodsmvt_items-entry_uom = 'ST'.
i_goodsmvt_items-move_type = mseg-bwart.
i_goodsmvt_items-plant = mseg-werks.
i_goodsmvt_items-stge_loc = mseg-lgort.
i_goodsmvt_items-move_plant = mseg-umwrk.
i_goodsmvt_items-move_stloc = mseg-umlgo.
i_goodsmvt_items-batch = witab-charg.
append i_goodsmvt_items.
endloop.
find BAPI processing transaction
if gv_code is initial.
perform determine_bapi_code using mseg-bwart
changing gv_code.
endif.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gv_header
goodsmvt_code = gv_code
importing
goodsmvt_headret = gv_headret
materialdocument = gv_matdoc
matdocumentyear = gv_matyear
tables
goodsmvt_item = i_goodsmvt_items
return = i_return[].
cancel blocking process
loop at i_return where type eq 'E' or type eq 'A' or type eq 'X'.
exit.
endloop.
if sy-subrc ne 0.
refresh i_message_tab.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
wa_message_tab-msgid = 'M7'..
wa_message_tab-msgty = 'S'.
wa_message_tab-msgno = '060'.
wa_message_tab-msgv1 = gv_matdoc.
wa_message_tab-msgv2 = ''.
wa_message_tab-msgv3 = ''.
wa_message_tab-msgv4 = ''.
append wa_message_tab to i_message_tab.
else.
refresh i_message_tab.
call function 'BAPI_TRANSACTION_ROLLBACK'.
write a message as there is an unexpected error.
loop at i_return.
wa_message_tab-msgid = i_return-id.
wa_message_tab-msgty = i_return-type.
wa_message_tab-msgno = i_return-number.
wa_message_tab-msgv1 = i_return-message_v1.
wa_message_tab-msgv2 = i_return-message_v2.
wa_message_tab-msgv3 = i_return-message_v3.
wa_message_tab-msgv4 = i_return-message_v4.
append wa_message_tab to i_message_tab.
endloop.
endif.
call function 'C14Z_MESSAGES_SHOW_AS_POPUP'
tables
i_message_tab = i_message_tab.
endform. " create_goods_movement
*& Form determine_bapi_code
form determine_bapi_code using p_bwart type bwart
changing p_code type bapi2017_gm_code.
data: lt_t158b type table of t158b with header line.
clear p_code.
select tcode from t158b into corresponding fields of table lt_t158b
where bwart eq p_bwart.
loop at lt_t158b.
select single gmcode from t158g into p_code
where tcode eq lt_t158b-tcode.
if sy-subrc is initial.
exit.
endif.
endloop.
endform. " determine_bapi_code
*& Form paging
form paging using code.
data: i type i,
j type i.
case code.
when 'P--'. tc_itab-top_line = 1.
when 'P-'.
tc_itab-top_line = tc_itab-top_line - line_count.
if tc_itab-top_line le 0.
tc_itab-top_line = 1.
endif.
when 'P+'.
i = tc_itab-top_line + line_count.
j = tc_itab-lines - line_count + 1.
if j le 0.
j = 1.
endif.
if i le j.
tc_itab-top_line = i.
else.
tc_itab-top_line = j.
endif.
when 'P++'.
tc_itab-top_line = tc_itab-lines - line_count + 1.
if tc_itab-top_line le 0.
tc_itab-top_line = 1.
endif.
endcase.
endform. " paging
*& Form write_alv
form write_alv .
perform find_list_header.
perform fill_field_cat.
perform fill_sortinfo.
g_repid = sy-repid.
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
answer = 'Y'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = ''
i_callback_program = g_repid
i_save = 'A'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = gs_layout
it_fieldcat = gt_fldcat[]
it_sort = gt_sortin[]
tables
t_outtab = itab[].
endform. " write_alv
Form find_list_header
form find_list_header.
data : v_datum(10),
v_datlo(10),
v_dathi(10),
v_uzeit(8).
clear: gt_header, gt_header[].
gt_header-typ = 'H'.
gt_header-info = sy-title.
append gt_header.
clear gt_header.
gt_header-typ = 'S'.
gt_header-key = 'Çalıştırma Zamanı : '.
write syst-datum to v_datum.
write syst-uzeit to v_uzeit.
concatenate v_datum '/' v_uzeit into gt_header-info.
append gt_header.
endform. " find_list_header
Form fill_field_cat
form fill_field_cat.
refresh gt_fldcat.
clear gt_fldcat.
gt_fldcat-key = 'X'.
add-fieldcat 'MATNR' 'MARA' ''.
add-fieldcat 'MAKTX' 'MAKT' ''.
add-fieldcat 'CHARG' 'MSEG' ''.
gt_fldcat-do_sum = 'X'.
add-fieldcat 'MEINS' 'MARA' 'Olcu Birimi '.
gt_fldcat-do_sum = 'X'.
add-fieldcat 'ERFMG' 'MSEG' 'Adet'.
endform. " fill_field_cat
Form fill_sortinfo
form fill_sortinfo.
gt_sortin-up = 'X'.
gt_sortin-fieldname = 'MATNR'. append gt_sortin.
endform. " fill_sortinfo
Form top_of_page *
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'ZKUTAS'
it_list_commentary = gt_header[].
endform. " top_of_pageHI,
if it is a normal report program then you can directly create a Selection screen field.
After the Type-pool you can use Parameters or Select-options to create the selection screen field..
If it is a Modulpool program then you can create a selection scren field like
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
PARAMETERS: p1(10) TYPE c.
SELECTION-SCREEN END OF SCREEN 1100.
defines a selection screens 1100 as subscreens.
The next screen number of screen 100 is 100 (statically-defined).
PROCESS BEFORE OUTPUT.
MODULE status_0100.
CALL SUBSCREEN area INCLUDING sy-repid number.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
CALL SUBSCREEN area.
MODULE user_command_0100.
look at the below link
http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
Regards
Sudheer -
Hi All,
I have a requirment that:
I need to refresh my selection screen at every time i selected back button.
Following fields are maintained in selection screen.
PARAMETERS pc_chgno TYPE ZTB1 OBLIGATORY MEMORY ID zbc_change_number.
PARAMETERS PC_PHONE TYPE telf1 OBLIGATORY.
PARAMETERS PC_DIR TYPE LOCALFILE OBLIGATORY default 'C:\' .
SELECT-OPTIONS pc_uname FOR sy-uname OBLIGATORY NO INTERVALS .
SELECT-OPTIONS pt_korr FOR e070-trkorr NO INTERVALS .
The last field is diaplaying some data when i select "Select more single value" button of the field.
This have to be clear when come back the screen.
Thanks,
SubbuHi,
Clear all the selection screen fields in the AT SELECTION-SCREEN OUTPUT event. So that it will be triggered each time when your screen displayed again.
Reward if useful.
Thanks,
Muthu. -
Regarding selection screen output
hi,
i have created ALV report by using selection screen.in this i have displayed kunnr field from kna1 table.
but it is showing someextra zero's and then code now i want to display only code not extra zero.here below i am giving example:----
sap code
00001562
but i want like this....
sap code
1562.
thanx/regards,
vaneet thakurTABLES : VBRK,KNA1.
TYPE-POOLS : SLIS.
DATA : T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_FIELDCAT TYPE SLIS_FIELDCAT_ALV, "DECLARATION OF FIELDCAT FOR OUTPUT DISPLAY
T_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBRK-VBELN, "PO NUMBER
VTEG LIKE VBRK-VTWEG, "DC
SPART LIKE VBRK-SPART, "DIVISION
FKDAT LIKE VBRK-FKDAT, "DATE
KUNRG LIKE VBRK-KUNRG, "CUSTOMER PLANT
WERKS LIKE VBRK-WAERK, "SITE
VKORG LIKE VBRK-VKORG, "SALE ORGANIZATION
NAME1 LIKE KNA1-NAME1,
ORT01 LIKE KNA1-ORT01,
END OF ITAB.
SELECTION-SCREEN : BEGIN OF BLOCK VANEET WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : SITE FOR VBRK-WAERK.
SELECT-OPTIONS : PCODE FOR VBRK-KUNRG.
*SELECT-OPTIONS : INVOICE FOR VBRK-VBELN.
SELECT-OPTIONS : S_ORG FOR VBRK-VKORG OBLIGATORY.
SELECT-OPTIONS : DC FOR VBRK-VTWEG OBLIGATORY.
SELECT-OPTIONS : DIVISION FOR VBRK-SPART obligatory.
*SELECT-OPTIONS : PO_DATE FOR VBRK-FKDAT.
SELECTION-SCREEN : END OF BLOCK VANEET.
SELECTION-SCREEN : BEGIN OF BLOCK VANEET1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS : INVOICE FOR VBRK-VBELN.
SELECT-OPTIONS : PO_DATE FOR VBRK-FKDAT.
SELECTION-SCREEN : END OF BLOCK VANEET1.
*PERFORM TOP-OF-PAGE.
PERFORM FETCH-DATA.
*PERFORM DISP_DATA.
PERFORM T_FIELDCAT.
PERFORM REUSE_ALV.
**& Form TOP-OF-PAGE
text
--> p1 text
<-- p2 text
*FORM TOP-OF-PAGE .
*FORMAT COLOR 3 INTENSIFIED OFF.
*FORMAT COLOR 5 INTENSIFIED OFF.
*write : /48(120) 'NAHAR RETAIL LTD'.
*FORMAT COLOR 3 INTENSIFIED OFF.
*write : /48(120) 'FOCAL POINT'.
*FORMAT COLOR 6 INTENSIFIED OFF.
*write : /48(120) 'LUDHIANA'.
*write : / sy-uline.
*format color 4.
**WRITE: /1(20) 'INVOICENO',
25(15) 'SAP CODE',
55(15) 'PARTYNAME',
100(50) 'LOCATION'.
format color 7 INTENSIFIED ON.
*ENDFORM. " TOP-OF-PAGE
*& Form FETCH-DATA
text
--> p1 text
<-- p2 text
FORM FETCH-DATA .
REFRESH ITAB.
SELECT AVBELN AKUNRG AFKDAT AWAERK BNAME1 BORT01 INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBRK AS A INNER JOIN KNA1 AS B
ON AKUNRG = BKUNNR
WHERE
A~VBELN IN INVOICE
and
A~FKDAT IN PO_DATE
and
B~KUNNR IN PCODE
GROUP BY AVBELN AKUNRG BNAME1 BORT01 AFKDAT AWAERK.
SORT ITAB ascending BY VBELN.
*ENDSELECT.
ENDFORM. " FETCH-DATA
**& Form DISP_DATA
text
--> p1 text
<-- p2 text
*FORM DISP_DATA .
*loop at itab.
*write :/1(18) itab-VBELN,
27(5) ITAB-KUNRG,
55(25) ITAB-NAME1,
100(50) ITAB-ORT01.
*endloop.
*ENDFORM. " DISP_DATA
*& Form T_FIELDCAT
text
--> p1 text
<-- p2 text
FORM T_FIELDCAT .
PERFORM fill_field USING 'VBELN' 'PO NO'.
PERFORM fill_field USING 'KUNRG' 'CUSTOMER PLANT'.
PERFORM fill_field USING 'NAME1' 'PARTY NAME'.
PERFORM fill_field USING 'ORT01' 'LOCATION'.
PERFORM fill_field USING 'BASME' 'UOM'.
PERFORM SELECTION_WIDTH.
ENDFORM. " T_FIELDCAT
*& Form fill_field
text
-->P_0267 text
-->P_0268 text
FORM fill_field USING p_fieldname
p_seltext.
L_FIELDCAT-FIELDNAME = p_fieldname.
L_FIELDCAT-TABNAME = 'ITAB'.
L_FIELDCAT-SELTEXT_M = p_seltext.
L_FIELDCAT-OUTPUTLEN = 10.
APPEND L_FIELDCAT TO T_FIELDCAT.
CLEAR L_FIELDCAT.
ENDFORM. " fill_field
*& Form REUSE_ALV
text
--> p1 text
<-- p2 text
FORM REUSE_ALV .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = T_LAYOUT
IT_FIELDCAT = T_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 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.
ENDFORM. " REUSE_ALV
*& Form SELECTION_WIDTH
text
--> p1 text
<-- p2 text
FORM SELECTION_WIDTH .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = itab-kunrg
IMPORTING
OUTPUT = itab-kunrg -
Hiding Screen fields in a Report selection screen
Hi Experts,
I have a requirement to hide/disable screen fields in a report selection screen when the user clicks on some radio buttons .
Here is the scenario,
1) There are 4 radio buttons four radiobuttons in one group on the selection screen:--
Block no:1
PARAMETER: r_not TYPE c RADIOBUTTON GROUP a1 DEFAULT 'X'.
PARAMETER: r_prgs TYPE c RADIOBUTTON GROUP a1.
PARAMETER: r_remv TYPE c RADIOBUTTON GROUP a1.
PARAMETER: r_noresp TYPE c RADIOBUTTON GROUP a1.
2) Based on the user clicking/selecting the radio buttons no.2,3 nad 4 i need to hide some fields in the other selection block
in the selection screen.The parameters are as follows:
Block no:2( These fields need to be hidden/disabled)
PARAMETER: r_occ(3) TYPE c OBLIGATORY DEFAULT '1'.
PARAMETER: r_and TYPE c RADIOBUTTON GROUP g1.
PARAMETER: r_or TYPE c RADIOBUTTON GROUP g1.
PARAMETER: r_days(3) TYPE c OBLIGATORY DEFAULT '1'.
ThanksContd.....
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
"When Customer button is clicked set flag 1
WHEN 'FC01'.
L_FLAG = '1'.
"When Sales Order button is clicked set flag 2
WHEN 'FC02'. "Sales order
L_FLAG = '2'.
"When Execute button is clicked set flag 4
WHEN OTHERS.
L_FLAG = '4'.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
CASE L_FLAG.
WHEN '1'. "When Customer button is clicked
LOOP AT SCREEN.
"Set the Production and Customer Block as inactive
IF SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL3'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN '2'. "When Sales Order button is clicked
LOOP AT SCREEN.
"Set the Production and Customer Block as inactive
IF SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN '3'. "When Refresh button is clicked
LOOP AT SCREEN.
"Set the all Blocks as active
IF SCREEN-GROUP1 = 'BL2' OR SCREEN-GROUP1 = 'BL3' OR SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN OTHERS."When Execute button is clicked
"Set the Sales order and Customer Block as inactive
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL2' OR SCREEN-GROUP1 = 'BL3'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
ENDFORM. -
JOB_SUBMIT with Selection Screen Value
I have a requirement :
with other select-options and parameters, i have two radio button, Foreground and Background:
when Background radio button will be selected program should be scheduled as a background job.
How i will pass selection screen value in JOB_SUBMIT ??
Cheers.
SrikantaHi ,
Try This
*& Report ZMMVB_PG_SL_CHANGE_BDC
REPORT zmmvb_pg_sl_change_bdc.
TABLES : mara,t133a,marc.
DATA i_t133a LIKE t133a OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
ekgrp LIKE marc-ekgrp,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
dispo LIKE marc-dispo,
END OF itab1.
DATA : fname LIKE ibipparms-path ,
ename TYPE string,
mode.
DATA: BEGIN OF it_t133a OCCURS 0,
bilds LIKE t133a-bilds,
pstat LIKE t133a-pstat,
guifu LIKE t133a-guifu,
auswg LIKE t133a-auswg,
END OF it_t133a.
DATA: ctr TYPE i,
ctr_s(2) TYPE n,
wrk(35),
ch(1),
viewno(2) TYPE n,
guifu LIKE t133a-guifu.
DATA: BEGIN OF it_views OCCURS 30.
INCLUDE STRUCTURE mbildtab. " Selection Views
DATA: END OF it_views.
DATA bdc_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-000.
PARAMETERS : ek RADIOBUTTON GROUP rg1 ,
sl RADIOBUTTON GROUP rg1
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-001.
PARAMETERS : fg RADIOBUTTON GROUP rg2 DEFAULT 'X',
bg RADIOBUTTON GROUP rg2.
SELECTION-SCREEN END OF BLOCK c.
START-OF-SELECTION.
IF fg = 'X'.
mode = 'A'.
ELSEIF bg = 'X'.
mode = 'E'.
ENDIF.
IF ek = 'X'.
guifu = 'SP09'.
PERFORM bdc_ekgrp_change.
ELSEIF sl = 'X'.
guifu = 'SP12'.
PERFORM bdc_mrpcontroller_change.
ENDIF.
*& Form BDC_EKGRP_CHANGE
* text
* --> p1 text
* <-- p2 text
FORM bdc_ekgrp_change .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = ' '
IMPORTING
file_name = fname.
IF NOT ( fname IS INITIAL ) .
ename = fname .
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = ename
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
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 itab[] IS NOT INITIAL.
LOOP AT itab.
REFRESH bdc_data.
IF itab-matnr NA sy-abcde AND itab-matnr NA '/*-_.'.
UNPACK itab-matnr TO itab-matnr.
ELSE.
TRANSLATE itab-matnr TO UPPER CASE.
ENDIF.
SELECT SINGLE * FROM mara WHERE matnr = itab-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM view_routine.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab-matnr.
CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
wrk. "'MSICHTAUSW-DYTXT(08)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_field USING wrk "'MSICHTAUSW-KZSEL(08)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
* PERFORM bdc_field USING 'MAKT-MAKTX'
* '"HEX BOLT M16X1.5X100,B8.8,BP"'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-EKGRP'.
* PERFORM bdc_field USING 'MARA-MEINS'
* 'NOS'.
PERFORM bdc_field USING 'MARC-EKGRP'
itab-ekgrp.
* PERFORM bdc_field USING 'MARA-MATKL'
* '1702'.
* PERFORM bdc_field USING 'MARC-USEQU'
* '3'.
* PERFORM bdc_field USING 'MARC-KORDB'
* 'X'.
CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
ENDLOOP.
ENDIF.
ENDFORM. " BDC_EKGRP_CHANGE
*& Form BDC_MRPCONTROLLER_CHANGE
* text
* --> p1 text
* <-- p2 text
FORM bdc_mrpcontroller_change .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = ' '
IMPORTING
file_name = fname.
IF NOT ( fname IS INITIAL ) .
ename = fname .
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = ename
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
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 itab1[] IS NOT INITIAL.
LOOP AT itab1.
REFRESH bdc_data.
IF itab1-matnr NA sy-abcde AND itab1-matnr NA '/*-_.'.
UNPACK itab1-matnr TO itab1-matnr.
ELSE.
TRANSLATE itab1-matnr TO UPPER CASE.
ENDIF.
SELECT SINGLE * FROM mara WHERE matnr = itab1-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM view_routine.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab1-matnr.
CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
wrk. "'MSICHTAUSW-DYTXT(11)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_field USING wrk "'MSICHTAUSW-KZSEL(11)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab1-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
* PERFORM bdc_field USING 'MAKT-MAKTX'
* '"HEX BOLT M16X1.5X100,B8.8,BP"'.
* PERFORM bdc_field USING 'MARA-MEINS'
* 'NOS'.
* PERFORM bdc_field USING 'MARC-DISGR'
* '701'.
* PERFORM bdc_field USING 'MARC-EKGRP'
* 'A00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-DISPO'.
* PERFORM bdc_field USING 'MARC-DISMM'
* 'PD'.
PERFORM bdc_field USING 'MARC-DISPO'
itab1-dispo.
* PERFORM bdc_field USING 'MARC-DISLS'
* 'MB'.
CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
ENDLOOP.
ENDIF.
ENDFORM. " BDC_MRPCONTROLLER_CHANGE
*& Form bdc_dynpro
* text
* -->PROGRAM text
* -->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdc_data.
bdc_data-program = program.
bdc_data-dynpro = dynpro.
bdc_data-dynbegin = 'X'.
APPEND bdc_data.
ENDFORM. "BDC_DYNPRO
* Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdc_data.
bdc_data-fnam = fnam.
bdc_data-fval = fval.
APPEND bdc_data.
ENDFORM. "BDC_FIELD
*& Form VIEW_ROUTINE
* text
* --> p1 text
* <-- p2 text
FORM view_routine .
CLEAR viewno.
SELECT * FROM t133a INTO CORRESPONDING FIELDS OF TABLE i_t133a
WHERE bilds = '21' AND guifu LIKE 'SP%' .
LOOP AT i_t133a .
ch = i_t133a-pstat.
IF mara-vpsta NA ch .
DELETE i_t133a .
CONTINUE .
ENDIF .
ENDLOOP.
SORT i_t133a BY guifu ASCENDING .
LOOP AT i_t133a .
viewno = viewno + 1 .
IF i_t133a-guifu = guifu .
EXIT .
ENDIF .
ENDLOOP .
ENDFORM. " VIEW_ROUTINE
Regards,
Maybe you are looking for
-
Windows 8.1 Pro Pack fails to install
Been trying to install Windows 8.1 Pro Pack on my Dell XPS but it continues to fail, indicating 'something went wrong'. I worked with two different Microsoft support techs on this. The first executed a number of scans and started dism.exe /online /
-
Query works using RSRT but in using BEX
Hi, I have a query with 8 custom variables. When I run it in RSRT I get the correct results. When I run it in Bex, the results are incorrect and I can see that the custom variables didn't get to the query. Any suggestions? Thanks Suzanne
-
The Characters panel hotkey is not working - help!
hi, Before Mavericks, I was able to use the Characters Panel by pressing cmd-opt-t hockey. After upgrading to Mavericks, this hotkey seems not working anymore. Is it just me or is there a bug in it? Any help appreciated. -Jason
-
Hi I have upgraded my Oracle 11g 11.2.0.4 from standard to enterprise version. When I try to use the sqladvisor I recevie the error: There was a problem creating a SQL tuning task. ORA-04063: package body "SYS.DBMS_SQLTUNE_INTERNAL" has errors ORA-0
-
Could not initialize photoshop because of a problem using the adobe color engine (Win 7)
Was running the lastest version of Photoshop CS5 and added a second quad graphics card and 4 more monitors. Now PS will not start and I get the error message "could not initialize photoshop because of a problem using the adobe color engine." Compute