Sudden jump out from selection screen (APO)
Hello,
I've developed a report which displays data in an ALV grid. When executing the program everything works fine but when the test user runs through the transaction code something goes wrong. The selection screen appears and you can enter desired selection criteria but when executing the report it just jumps out to the main SAP start page. Does anyone know how to fix this?
The settings for the transaction code seems to be alright...
Type: Report transaction
Sel. screen: 1000
All SAP GUI are ticked (HTML, JAVA and WINDOS)
Appreciate all help I can get in this matter.
Best regards,
Mia
Thank you for your tips!
The test user has already been granted the role necessary to run the transaction, according to our SAP security people, but there might be some additional authorization needed.
SU53 does not log anything when executing the transaction and no output validation is written in the select screen. I'm using a standard ALV class to display retrieved records and have had no problem with it previously.
Best regards,
Mia
Similar Messages
-
Calling a Transaction from Selection screen of Z Program...
Hi,
I am trying to call a Standard transaction from a report when they clicked one push button on selection screen.
when i used CALL TRANSACTION 'MM01'. When i press save after entering the values in MM01, it is saving and coming out to selection screen of my Z program.
But my question is when they press in BACK button in MM01 then only it should come out from MM01 and it should display the my Z Program selection screen. suppose if they press SAVE button on MM01 it should save and screen should be MM01 only.
when i used LEAVE TO TRANSACTION 'MM01'. it is working fine but when i press BACK button from MM01 it is coming out and showing SAP EASY ACCESS screen. My requirement is when i press back button in MM01 then it must come to my Z program selection screen only.
I hope it is clear.
Regards,
Sunny>
sunny_143 wrote:
> Hi,
>
> I am trying to call a Standard transaction from a report when they clicked one push button on selection screen.
>
> when i used CALL TRANSACTION 'MM01'. When i press save after entering the values in MM01, it is saving and coming out to selection screen of my Z program.
>
> But my question is when they press in BACK button in MM01 then only it should come out from MM01 and it should display the my Z Program selection screen. suppose if they press SAVE button on MM01 it should save and screen should be MM01 only.
>
>
> when i used LEAVE TO TRANSACTION 'MM01'. it is working fine but when i press BACK button from MM01 it is coming out and showing SAP EASY ACCESS screen. My requirement is when i press back button in MM01 then it must come to my Z program selection screen only.
>
> I hope it is clear.
>
> Regards,
> Sunny
I'm not clear about what happens when you press the BACK button.
First, LEAVE TO TRANSACTION is no help. That ends your Z program. CALL TRANSACTION is your only option. If it doesn't work as you'd like, you're a bit stuck, as MMnn are standard SAP transactions, and you can't modify that. (well, you can, but that's a whole other tin of worms).
Perhaps if you told us what you're trying to achieve with the Z program, there might be another approach that will do that.
matt -
HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
HI,
HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
thanks,
samba.By selection screen, what do you mean? There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component? Are you wanting to call a standard transaction via ITS - SAPGUI for HTML? Please provide more details to your question.
-
Problem in getting parameter value from selection screen in web dynpro abap
Hi,
I am facing problem in getting parameter value from selection screen.
Please find my code below:
DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
<FS_OBJ_USAGE> TYPE REF TO data.
WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
CASE <FS_PAR_ITEM>-M_ID.
WHEN `OBJ_USAGE`.
ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.
[ Here, sy-subrc is 4, <FS_OBJ_USAGE> is not assigning.]
ENDCASE.
ENDLOOP.
So, can any one solve this problem.
Thanks in advance,
RadhikaHi Radhika,
Try using GET_RANGE_TABLE_OF_SEL_FIELD...
Please Refer below code..
DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
DATA: RT_CARRID TYPE REF TO DATA.
DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
DATA: WSFLIGHT TYPE SFLIGHT.
FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
Retrieve the data from the select option
RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
Assign it to a field symbol
ASSIGN RT_CARRID->* TO <FS_CARRID>.
CLEAR ISFLIGHT. REFRESH ISFLIGHT.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
WHERE CARRID IN <FS_CARRID>.
NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
Thanks,
Regards,
Kiran -
Restrict 'Executing report in background' from selection screen
I want user to not to select option for executing report in background from Selection Screen of the program.
i.e. 'Execute Program in Background' option in 1st menu bar tab should either be disabled OR if user clicks on it then he should get error message on selection screen itself.
Thanks,
FalguniHi Falguni,
Write the code based on function code SJOB in the event AT SELECTION-SCREEN. Write the following code :
AT SELECTION-SCREEN
CASE SY-UCOMM.
WHEN 'SJOB'.
MESSAGE E000 WITH 'You cannot schedule background job'.
ENDCASE.
Thanks & Regards,
Faheem. -
RESCIS - Unable to select custom report from Selection Screen
Hi all,
we have developed a custom report for transaction "RESCIS-Evaluation of service charge settlement" but we have found that althought the report appears in selection screen field called "REPORT" it throws message RESCIS003 but the report is not shown.
If we doesn't fulfill report field in selection screen, the program shows a second screen where a couple of ALVGrids are shown allowing the user to select the report that will be displayed. Here we are able to select our custom report and the data in it is displayed.
We have analyzed the standard program that is executed via transaction RESCIS and we've found that the selection screen executes standard function RESC_GUI_ANYREPORTS_APPL that doesn't executes reports dinamically but statically. That means that SAP doesn't allows to execute custom reports directly from selection screen.
I think this is a SAP error but afert opening an OSS message SAP sais that is not an error but a bad configuration or lack of knowledge for customizing it.
Has anyone developed a custom report for RESCIS transaction?Hm what exactly did you want to change? Normally it is in REFX cases you should not copy standard REPORTS. In your case with transaction RESCIS, I myself do not see any need to add any functionality in this report because it is only a sum of all lists from your service charge settlement. What else do you want to see there?
For displaying new fields in the separate lists maybe there is some BADI for it.
Regards
Michael -
Xperia UI frozen after coming out from lock screen
I find the app switcher and notification bar inaccessible when the phone comes out from lock screen. Swiping down or pressing the task switcher does nothing.
Solved!
Go to Solution.That's the problem, uninstall it > press and hold power & volume up for 5 seconds and check again
"I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994) -
Reading Text File from selection Screen and populating table (Urgent)
Hi All,
I have some requirment like i in my report i have to initial my Input feild from text file is it good to populate a internal table or range.
I have three feild in a excel file that entry can more then 500
data example
Matnr Date Day
A1 10.07.2007 12
B1 10.07.2007 10
A1 19.07.2007 15
C1 20.08.2007 30
E1 11.09.2007 12
This report for Price Protection claim.
even u can help me out with proper table plz this is urgent.Hi..
<b>parameters:</b>
p_file(50) type c.
<b>data:</b>
begin of itab occurs 0,
matnr type vbak-matnr,
date type sy-datum,
day(2) type n,
end of itab.
<b>at selection-screen on value-request for p_fname.</b>
perform get_path.
<b>start-of-selection.</b>
<b>CALL FUNCTION 'GUI_UPLOAD'</b>
<b>EXPORTING
FILENAME = p_fname
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'</b>
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
<b> TABLES
DATA_TAB = itab</b>
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.
This Sub routine is used to get the file name
*There are no interface parameters passed to this subroutine.
FORM get_path .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = P_FNAME
DEF_PATH = ' '
MASK = ' '
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME = P_FNAME
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
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. " get_path
data: -
i find that i am suddenly logged out of program or an app or website, and i am back to the HOME screen. i have to log back in and sometimes i find back exactly where i left off, some stuff i have entered or written, or sometimes i have to start all over again and re-enter data or write back what i seem to have lost.
i tried a different browser and it does not solve the problem. i tried different apps, website and programs and it happens anywhere and at any app, program or website.
apple staff suggested a complete restore of the IOS software, which is quite an involved process. does anyone know of any possible causes and a simpler
solution without having to reset the entire IOS 7.0.6Hello Philly,
I believe that when you reset your ipod(command given from the computer, right?) touch WHILE the ipod was updating, It cleared the system in the middle of writing files, thus corrupting(equivalent of cutting of in the middle of a sentence) the basic running system.
I suggest you go to an apple store and ask for a technical diagonosis in person. they may offer to help if the problem is fixable. If your ipod is still under warrenty, i would guess it would be free/low cost.
~Remember, I am just giving an educated guess on limited information -
Unable to retreive values from selection screen built using WDR_SELEC_OPTIO
Hi All,
I have created a selection screen as below
lr_field = wd_this->m_handler->create_range_table( 'YFMTFLOW' ).
* ASSIGN lr_field->* TO <fs_range>.
* ls_date-sign = 'I'.
* ls_date-option = 'EQ'.
* ls_date-low = 'US'.
* APPEND ls_date TO <fs_range>.
* Add the select-option to the group
wd_this->m_handler->add_selection_field(
i_id = 'FLOW'
i_within_block = 'PROC'
i_no_intervals = abap_true
it_result = lr_field ).
If i enter some value and click a button to retireve the values as below
DATA
lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.
types: ty_flow type range of yfmtflow.
FIELD-SYMBOLS:
<fs_sel_item> LIKE LINE OF lt_sel_item,
<fs_process> TYPE yfmtprocess,
<fs_flow> TYPE ty_flow.
* Get the selection-screen items
l_handler->get_selection_screen_items(
IMPORTING et_selection_screen_items = lt_sel_item ).
* Retrieve the values from the select-options items
LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
CASE <fs_sel_item>-m_id.
WHEN `PROCESS`.
ASSIGN <fs_sel_item>-m_value->* TO <fs_process>.
WHEN 'FLOW'.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_flow>.
ENDCASE.
ENDLOOP.
<fs_flow> is empty
but after I enter value and then press enter and then click the button to retrieve the values I am able to get low value <fs_flow> not the sign and option
Is it the standard functionality ,if yes how can we overcome
Thanks
Bala DuvvuriAm giving clear coding of select options.
nOTE: S_CARR_ID IS THE DATA ELEMENT OF CARR ID FIELD,
FOR THAT I AM APPLYING SELECT OPTIONS IN BELOW CODING.
WRITE THE BELOW CODE IN WDDOINT( ) METHOD OF
REQUIRED VIEW
Data: lt_range_table type ref to data,
read_only type abap_bool.
WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS-
>WD_CPIFC_SELECT_OPTIONS( ).
WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS-
>INIT_SELECT_SCREEN( ).
WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
I_DISPLAY_BTN_CANCEL = ABAP_FALSE
I_DISPLAY_BTN_CHECK = ABAP_FALSE
I_DISPLAY_BTN_RESET = ABAP_FALSE
I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
LT_RANGE_TABLE = WD_THIS->M_HANDLER-
>CREATE_RANGE_TABLE( I_TYPENAME = 'S_CARR_ID' ).
WD_THIS->M_HANDLER->ADD_SELECTION_FIELD(
I_ID = 'S_CARR_ID'
IT_RESULT = LT_RANGE_TABLE
I_READ_ONLY = READ_ONLY ).
BELOW CODE IN REQUIRED ACTION( SAY IN SOME BUTTON
ACTION WHICH WILL RETRIEVE THE DATA FROM DATABASE TABLE
USING SELECTI OPTIONS VALUES)
fIRST THE GET REFERENCE TO NODE( CTRL F7--->READ
CONTEXTB---FLIGHT NODE )
***THEN BELOW CODE
DATA: RT_CARRID TYPE REF TO DATA.
DATA:IS_FLIGHT TYPE TABLE OF SFLIGHT.
FIELD_SYMBOLS: <FS_CARRID> TYPE TABLE.
RT_CARRID = WD_THIS-> M_HANDLER-
>GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
ASSIGN RT_CARRID-> TO <FS_CARRID>.*
SELECT * INTO CORRRESPONDING FIELDS OF TABLE IS_FLIGHT
FROM SFLIGHT WHERE CARRID IN <FS_CARRID>
NODE_FLIGHT->BIND_TABLE( IS_FLIGHT ). -
How to find out the selection screen values
Hi All,
in BI we are having the maximum allowed cells as 500000 for a report.
for some of the reports execution fetching the data morethan 500000 by different users.
i could findout the report and user who has executed, But i wanted to findout for which selection user has executed.
is it possible to find out...please help.
Thanks,
Krishna.Hi,,
Yes it is possible.
Open your query result in the design mode by going to BEx Analyzer->Design ToolBar
Now take one text element and assign it to the variable which you have used for the selection screen.
Take the same number of text element as there are in selection screen.
Exit the design mode. In place of the text element you will find the value of the variables assigned to them. -
How to use a parameter of a report program from selection screen in a dialog program
how to use a parameter value(entered ) of a report program from a selection screen in a dialog program.
I have to fetch the value entered in the parameter of report program and display it in a dialog programHi Aasim,
Just mention like below in your ABAP report.
PARAMETERS: p_aufnr TYPE aufnr MEMORY ID ord.
and mention the same memory ID name in the module pool screen property it automatically populates the value to and fro -
Passing parameter from selection screen to corresponding report program.
Hi all,
I am developing a report in which there is a selection screen containing 2 list boxes having month 'from' and 'to' ;ie the month range for which the report is to be run and a parameter for year.below it i have 2 radio button options which will lead to the report that the user clicks on.
I have done the following in the code.
selection-screen begin of block b1 with frame title text-001.
parameters: month1(10) as listbox visible length 10 obligatory.
parameters: month2(10) as listbox visible length 10.
parameters: year(4) obligatory.
selection-screen : end of block b1.
selection-screen: begin of block b2 with frame title text-002.
parameters: rb1 radiobutton group g1,
rb2 radiobutton group g1.
selection-screen : end of block b2.
if rb1 = 'X'.
submit ZMIS1.
ENDIF.
if rb2 = 'X'.
submit ZMIS2.
endif.
Now i want the values selected in the listbox and the year to be passed in the report that will be selected in the radiobutton (ie ZMIS1 or ZMIS2) so that the corresponding report output will be displayed directly with the inputs given in the selection screen .
Please tell me how to do this.Thanks in advance.You also have to pass Selection-screen data for called program the way it has been shown down.
REPORT ZVENKAT_ALV_LIST.
DATA:
IT_RSPARAMS TYPE STANDARD TABLE OF RSPARAMS,
WA_RSPARAMS LIKE LINE OF IT_RSPARAMS.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: MONTH1(10) AS LISTBOX VISIBLE LENGTH 10 OBLIGATORY.
PARAMETERS: MONTH2(10) AS LISTBOX VISIBLE LENGTH 10.
PARAMETERS: YEAR(4) OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK B1.
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: RB1 RADIOBUTTON GROUP G1 USER-COMMAND UC1,
RB2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN : END OF BLOCK B2.
IF RB1 = 'X'.
WA_RSPARAMS-SELNAME = 'P_MATNR'. "PARAMETER or SELECT-OPTION of the called program
WA_RSPARAMS-KIND = 'P'. "S=Select-options P=Parameters
WA_RSPARAMS-SIGN = 'I'.
WA_RSPARAMS-OPTION = 'EQ'.
WA_RSPARAMS-LOW = '11010'.
WA_RSPARAMS-HIGH = SPACE.
SUBMIT ZMIS1 WITH SELECTION-TABLE RSPARAMS AND RETURN.
ENDIF.
IF RB2 = 'X'.
WA_RSPARAMS-SELNAME = 'P_MATNR'. "PARAMETER or SELECT-OPTION of the called program
WA_RSPARAMS-KIND = 'P'. "S=Select-options P=Parameters
WA_RSPARAMS-SIGN = 'I'.
WA_RSPARAMS-OPTION = 'EQ'.
WA_RSPARAMS-LOW = '11010'.
WA_RSPARAMS-HIGH = SPACE.
SUBMIT ZMIS2 WITH SELECTION-TABLE RSPARAMS AND RETURN.
ENDIF.
Thanks
Venkat.O -
ALV grid list report when selected from selection screen
Hi folks,
I need to get ALV grid display in my list report when selected the interval values from the selection screen. If I change the values in list of ALV grid it needs to be updated when I press UPDATE pushbutton. The output of list should be in ALV grid display.I need sorting ,flitering,totaling functionality in the list output.
For example if I selected BUKRS = 100 and 200 in the selection screen ,I need to display the ALV grid list in below the selection screen as ALV grid display...
Its urgent as I am new to ALV grid functionality...
Thanks in advance..hi raja,
check with the folllowing code.
REPORT zca0m_zca0fcstftop NO STANDARD PAGE HEADING
MESSAGE-ID zcsv_usrtbl_maintain.
Type pools *
TYPE-POOLS : slis. " Used for ALV display
Tables
TABLES: zca0fcstftop,
dd04t, "R/3 DD: Data element texts
tactt. "Activities that can be protected
internal tables
DATA: BEGIN OF wa_zca0fcstftop .
INCLUDE STRUCTURE zca0fcstftop.
DATA: END OF wa_zca0fcstftop.
DATA: t_zca0fcstftop LIKE STANDARD TABLE OF wa_zca0fcstftop.
DATA: BEGIN OF i_fcode OCCURS 0,
fcode LIKE sy-ucomm,
END OF i_fcode.
*Record for variant selection
DATA : BEGIN OF ws_variant,
selected TYPE c,
variant LIKE ltdx-variant, "Variant name
text LIKE ltdxt-text, "Variant description
END OF ws_variant.
*Table for variant selection
data : itab_variant LIKE STANDARD TABLE OF ws_variant WITH HEADER LINE.
Variant selection pop-up global variables
DECLARATION OF TABLECONTROL 'VARIANT_CNTL' ITSELF
CONTROLS: variant_cntl TYPE TABLEVIEW USING SCREEN 0200.
LINES OF TABLECONTROL 'VARIANT_CNTL'
DATA: g_variant_cntl_lines LIKE sy-loopc.
DATA:grid1 TYPE REF TO cl_gui_alv_grid ,
g_custom_container TYPE REF TO cl_gui_custom_container.
Work fields
DATA: table_name LIKE dd02l-tabname, "To store table name
field_name LIKE dd03l-fieldname, "To Store Field Name
act_auth LIKE tactz-actvt, "To pass Activity ID
tab_maint LIKE dd02l-tabname, "To pass Table Name to be Maintd.
wg_confirm_ind, "To trap User responses
flag, "To trap changes made to an entry
f_copy, "To Identify 'COPY' Command Use
f_select, "To decide between Select-options
" and Internal Table
l_transaction_code LIKE tstc-tcode,
v_langu LIKE sy-langu,
v_repid LIKE sy-repid,
s_variant TYPE disvariant.
DATA: ok_code LIKE sy-ucomm.
DATA:selected_rows TYPE lvc_t_row ,
sel_rows TYPE lvc_t_row WITH HEADER LINE.
DATA:t_lines TYPE i.
Constants *
CONSTANTS :
c_x TYPE c VALUE 'X', " Constant 'X'.
c_f TYPE c VALUE 'F'. " Constant 'F'.
Parameters and Selection Options
*Selection Screen for table maintenance
*Selection option for Plant
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-b01.
PARAMETERS: p_werks LIKE zca0fcstftop-werks OBLIGATORY.
SELECT-OPTIONS: s_prdfml FOR zca0fcstftop-product_family,
s_bmach FOR zca0fcstftop-base_machine,
s_factop FOR zca0fcstftop-factory_top,
s_optval FOR zca0fcstftop-option_value,
s_week FOR zca0fcstftop-week.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-b02.
PARAMETERS : p_varant LIKE ltdx-variant. " ALV variant
SELECTION-SCREEN END OF BLOCK block2.
At selection screen *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varant.
PERFORM alv_variant_f4 CHANGING p_varant.
AT SELECTION-SCREEN ON p_werks .
Validating Plant on the selection screen
PERFORM validate_plant.
Initialization
INITIALIZATION.
Check Authorization for the Transaction
Authorization Check For T Code
SELECT tcode
INTO l_transaction_code
FROM tstc UP TO 1 ROWS
WHERE pgmna = sy-repid.
ENDSELECT.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD l_transaction_code.
IF sy-subrc NE 0.
MESSAGE e001 WITH l_transaction_code.
ENDIF.
v_langu = sy-langu. " language
v_repid = sy-repid . " abap Program name
Start Of Selection
START-OF-SELECTION.
CALL SCREEN 0050.
*& Form validate_plant *
Validating Plant on the selection screen *
FORM validate_plant .
DATA : l_werks LIKE t001w-werks. " Plant
IF p_werks IS NOT INITIAL.
SELECT SINGLE werks
FROM t001w
INTO l_werks
WHERE werks EQ p_werks.
IF sy-subrc NE 0.
MESSAGE e100(ra) WITH text-001 .
ENDIF.
ENDIF.
AUTHORITY-CHECK OBJECT 'Z_PP_PLANT'
ID 'ACTVT' FIELD '03'
ID 'WERKS' FIELD p_werks
ID 'TCD' FIELD l_transaction_code.
IF sy-subrc NE 0.
MESSAGE e000(oo) WITH 'No authorization for plant:'(e80) p_werks.
ENDIF.
ENDFORM. " validate_plant
*& Form get_data *
Get data *
FORM get_data .
SELECT * FROM zca0fcstftop
INTO TABLE t_zca0fcstftop
WHERE werks = p_werks
AND product_family IN s_prdfml
AND base_machine IN s_bmach
AND factory_top IN s_factop
AND option_value IN s_optval
AND week IN s_week.
ENDFORM. " get_data
*& Form fill_fcode
FORM fill_fcode USING value(p_0029).
i_fcode-fcode = p_0029.
APPEND i_fcode.
CLEAR i_fcode.
ENDFORM. " fill_fcode
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'UPDATE'.
CLEAR flag.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module MODIFY_0100 OUTPUT
MODULE modify_0100 OUTPUT.
IF sy-ucomm = 'CHNG' OR
sy-ucomm = 'PICK'.
LOOP AT SCREEN.
CHECK screen-group1 = 'CHG'.
screen-required = '0'.
screen-output = '1'.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Check if you are in create mode & if yes then set the screen elements
as mandatory
IF ok_code = 'CREA'.
LOOP AT SCREEN.
CHECK screen-group1 = 'CHG'.
screen-required = '1'.
screen-output = '1'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE. " MODIFY_0100 OUTPUT
*& Module Check_Exit INPUT
text
MODULE check_exit INPUT.
IF ( sy-ucomm = 'BACK' OR sy-ucomm = 'CANC' OR sy-ucomm = 'EXIT' ) AND
( flag = 'Y' ).
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y'
textline1 = text-008
textline2 = text-009
titel = text-004
cancel_display = ' '
IMPORTING
answer = wg_confirm_ind.
CASE wg_confirm_ind.
WHEN 'J'. "Yes
sy-ucomm = 'SAVE'.
CLEAR flag.
WHEN 'N'. "No
sy-ucomm = 'BACK'.
CLEAR flag.
ENDCASE.
ENDIF.
ENDMODULE. " Check_Exit INPUT
*& Module Exit_0100 INPUT
text
MODULE exit_0100 INPUT.
SET SCREEN 0. LEAVE SCREEN.
ENDMODULE. " Exit_0100 INPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'. "Save
Check to see if the user has the appropriate authorization
IF p_werks NE zca0fcstftop-werks.
could not update - not in selection
MESSAGE e000(oo) WITH 'Entry not within selection'.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ENDIF.
IF f_copy = 'X'.
INSERT zca0fcstftop.
IF sy-subrc = 0.
MESSAGE s004.
PERFORM initialize.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ELSE.
MESSAGE w005.
ENDIF.
ELSE.
MODIFY zca0fcstftop.
IF sy-subrc = 0.
MESSAGE s004.
PERFORM initialize.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ELSE.
MESSAGE w005.
ENDIF.
ENDIF.
PERFORM get_data.
WHEN 'BACK'. "Back
SET SCREEN 0. LEAVE SCREEN.
WHEN 'CANC'. "Cancel
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
COMMIT WORK.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form Initialize
FORM initialize.
CLEAR : table_name,
field_name,
wg_confirm_ind,
f_copy,
flag,
t_zca0fcstftop,
zca0fcstftop,
wa_zca0fcstftop,
i_fcode.
REFRESH: t_zca0fcstftop.
ENDFORM. " Initialize
*& Form alv_variant_f4
text
<--P_VARIANT text
FORM alv_variant_f4 CHANGING variant.
DATA: rs_variant LIKE disvariant.
DATA nof4 TYPE c.
CLEAR nof4.
LOOP AT SCREEN.
IF screen-name = 'VARIANT'.
IF screen-input = 0.
nof4 = 'X'.
ENDIF.
ENDIF.
ENDLOOP.
rs_variant-report = sy-repid.
rs_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = rs_variant
i_save = 'A'
IMPORTING
es_variant = rs_variant
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0 AND nof4 EQ space.
variant = rs_variant-variant.
ENDIF.
ENDFORM. " ALV_VARIANT_F4
*& Module STATUS_0050 OUTPUT
text
MODULE status_0050 OUTPUT.
In this module Initialize the container and put the grid in it
DATA:grid_layout TYPE lvc_s_layo,
fieldcat TYPE lvc_t_fcat,
wa_fieldcat LIKE LINE OF fieldcat.
PERFORM set_auth.
SET PF-STATUS 'UPD_0050' EXCLUDING i_fcode.
SET TITLEBAR 'UPD_0050'.
IF g_custom_container IS INITIAL .
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'FTDATA'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container.
ELSE.
CALL METHOD grid1->free.
CALL METHOD g_custom_container->free.
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'FTDATA'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container.
ENDIF.
Every time refresh The variables
PERFORM initialize.
PERFORM get_data.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZCA0FCSTFTOP'
CHANGING
ct_fieldcat = fieldcat.
grid_layout-grid_title = text-t01.
grid_layout-sel_mode = 'A'.
grid_layout-stylefname = 'CT'.
s_variant-report = sy-repid.
s_variant-username = sy-uname.
s_variant-variant = p_varant.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'ZCA0FCSTFTOP'
is_layout = grid_layout
is_variant = s_variant
i_save = 'A'
CHANGING
it_outtab = t_zca0fcstftop
it_fieldcatalog = fieldcat.
Create Object to receive events and link them to handler methods.
When the ALV Control raises the event for the specified instance
the corresponding method is automatically called.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_button_click FOR grid1.
ENDMODULE. " STATUS_0050 OUTPUT
*& Module USER_COMMAND_0050 INPUT
MODULE user_command_0050 INPUT.
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = selected_rows.
DESCRIBE TABLE selected_rows LINES t_lines.
IF t_lines > 1 .
MESSAGE e048(zcsv_sfdr).
ENDIF.
Clear Header
CLEAR wa_zca0fcstftop.
sel_rows[] = selected_rows .
READ TABLE sel_rows INDEX 1.
READ TABLE t_zca0fcstftop INTO wa_zca0fcstftop INDEX sel_rows-index.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'CREA'.
CLEAR zca0fcstftop.
ok_code = sy-ucomm.
zca0fcstftop-werks = p_werks.
CALL SCREEN 100.
WHEN 'COPY'.
MOVE wa_zca0fcstftop TO zca0fcstftop .
CLEAR wa_zca0fcstftop.
f_copy = 'X'.
CALL SCREEN 100.
WHEN 'CHNG'.
CHECK NOT wa_zca0fcstftop IS INITIAL.
MOVE wa_zca0fcstftop TO zca0fcstftop .
CLEAR wa_zca0fcstftop.
ok_code = sy-ucomm.
CALL SCREEN 100.
WHEN 'DELE'.
CHECK NOT wa_zca0fcstftop IS INITIAL.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'N'
textline1 = text-005
textline2 = text-006
titel = text-007
cancel_display = ' '
IMPORTING
answer = wg_confirm_ind.
IF wg_confirm_ind EQ 'J'.
DELETE zca0fcstftop FROM wa_zca0fcstftop .
IF sy-subrc EQ 0.
MESSAGE s004.
ELSE.
MESSAGE e005.
ENDIF.
ELSEIF wg_confirm_ind EQ 'N'.
ENDIF.
ENDCASE.
CLEAR ok_code.
ENDMODULE. " USER_COMMAND_0050 INPUT
*& Form exit_program
FORM exit_program .
CALL METHOD g_custom_container->free.
CALL METHOD cl_gui_cfw=>flush.
SET SCREEN 0.
LEAVE SCREEN.
ENDFORM. " exit_program
*& Form set_auth
FORM set_auth.
REFRESH: i_fcode.
Check authorization for change
MOVE '02' TO act_auth. "02 --> Change
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'CHNG'.
ENDIF.
Check for authorization for create
MOVE '01' TO act_auth. "01 --> Create
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'CREA'.
PERFORM fill_fcode USING 'COPY'.
ENDIF.
Check for authorization for delete
MOVE '06' TO act_auth. "06 --> Delete
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'DELE'.
ENDIF.
ENDFORM. " set_auth
*& Module check_change INPUT
MODULE check_change INPUT.
flag = 'Y'.
ENDMODULE. " check_change INPUT
regards,
vikas.
plz reward if helpful -
Create a flat list from SELECTION-SCREEN
Hi,
I have a selection for date on in an report,
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF BLOCK blk1.
I want to create a flat list of dates from this selection. This list should exclude the date(s), which are excluded in the selection.
Please give some starters on how to do this.
Thank you,
CDHere is another example, adding the dates to an internal table.
REPORT zrich_0001.
TYPES: BEGIN OF t_datum,
datum TYPE sy-datum,
END OF t_datum.
DATA: lt_datum TYPE TABLE OF t_datum.
DATA: ls_datum LIKE LINE OF lt_datum.
DATA: lv_date TYPE sy-datum.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF BLOCK blk1.
INITIALIZATION.
lv_date = '19000101'.
START-OF-SELECTION.
DO.
IF lv_date IN dat_rang.
ls_datum-datum = lv_date.
APPEND ls_datum TO lt_datum.
ENDIF.
lv_date = lv_date + 1.
IF lv_date = '20500101'.
EXIT.
ENDIF.
ENDDO.
LOOP AT lt_datum INTO ls_datum.
WRITE:/ ls_datum-datum.
ENDLOOP.
Regards,
Rich Heilman
Maybe you are looking for
-
How to upload sales order line items?
SAPGurus, For years my customer service department has been asking for a way to upload sales order line items into the VA01 sales order-entry screen. Many of our customers submit PO's with huge amount of line items, up to 1,000 lines. Our CS reps nee
-
Photoshop CS6 update error U44M2P22 or U44M2I218
I bought the permanent license version of Photoshop CS6 standard. as-installed, it is version 13.0.0 I wanted to update to 13.0.4. so I tried installing via update feature. got an error. so I manually downloaded the 13.0.4 updater patch. still get
-
Why is my history blank?
My history has stopped working, and no longer shows or keeps the sites I have seen in either the recent history or show all history and stays blank. The address bar is unaffected though. What is wrong and how do I fix it?
-
Reading material ledger header record
Dear Gurus, I am getting the following error when i save the 561 movement posting. Error reading material ledger header record Message no. C+065 Diagnosis Internal error in function module CKMS_HEADER_READ_WITH_ITAB. System Response The transaction w
-
Hi All When I try to export the data from the People> Enter and Maintain using the Export Data icon, I am getting the following error mssg: "Function not available to this responsibility. Change responsibilites or contact system administrator. And al