Problem with CURSOR on Selection-Screen
Hi Experts,
This question is for you. We have recently upgraded our system to 7.01 Stack 5 (Enhancement Pack 1).
The screen supplied by a custom transaction is quite behaving in a strange manner. Whenever we execute the transaction the CURSOR appears by default at the 3rd Radio button and the UP/DOWN keys present in keyboard are not working and we have to place it back to the correct position using Mouse.Our customer raised a Ticket to check this.
Please suggest a work around for this.I need to remove this cursor blink completely at the selection screen.
Best Regards,
lakshman.
Hi,
Not sure to really get the issue... looks like your radiobuttons are not grouped properly and default is set on the third one...(?)
So just use the same radiobutton group for the three buttons and set the first one as default, either on selection screen or initialization level...
Kr,
Manu.
Similar Messages
-
Problem with the default selection screen condition
hi guys,
I have got some problem with the default screen given by the PNP logical database, P0000 infotype automatically populated according to the condition given in default screen.
Reg,
HariharanDon know what u r trying to acheive.
1) when u have specified PNP in the logical databse field of attributes of program, the SAP wil proivde u default PNP screen and here u can also add ur paramters if u want.
2) in the program u have to declare like
INFOTYPES: 0000,0001. "Etc
for all the infotypes u want to use in the program.
3) it is the GET PERNR event which wil fil all the p0000 and p0001 (internal tables for al the infotypes declared via INFOTYPES syntax as shown above)
4) after tht get pernr, u now have data in P tables and u can use it for further reporting.
5) refer below dummy code -
REPORT ZPPL_PREVEMPLOYERS message-id rp
line-size 250
line-count 65.
*Program logic :- This Report is used to Download all the Previous
* Employer (IT0023) records of the employees
*eject
*& Tables and Infotypes *
tables: pernr.
infotypes: 0000,
0001,
0002,
0023.
*eject
*& Constants *
constants: c_1(1) type c value '1' ,
c_3(1) type c value '3' ,
c_i(1) type c value 'I' ,
c_x(1) type c value 'X' ,
c_eq(2) type c value 'EQ' ,
c_pl03 like p0001-werks value 'PL03'.
*eject
*& Selection-Screen *
parameters: p_file like rlgrap-filename default 'C:TempABC.xls',
p_test as checkbox default c_x .
*eject
*& Internal tables *
* Internal Table for Output
data: begin of t_output occurs 0 ,
pernr like pernr-pernr ,
nachn like p0002-nachn ,
vorna like p0002-vorna ,
orgeh_stext like p1000-stext ,
plans_stext like p1000-stext ,
begda like p0023-begda ,
endda like p0023-endda ,
land1 like p0023-land1 ,
arbgb like p0023-arbgb ,
ort01 like p0023-ort01 .
data: end of t_output .
*eject
*& Variables *
data: o_stext like p1000-stext,
p_stext like p1000-stext.
*eject
*& Initialization *
Initialization.
* Initialize Selection-Screen values
perform init_selction_screen.
*eject
*& AT Selection-screen *
at selection-screen .
* Check if Test run selected, download file name should be entered
if p_test is initial. "
if p_file is initial.
message e016 with 'Please enter file name'
'specifying complete path'.
endif.
endif.
*eject
*& Start-of Selection *
Start-of-selection.
get pernr.
clear t_output.
* Read Infotype 0
rp-provide-from-last p0000 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* Check if employee is active
check p0000-stat2 in pnpstat2. "pernr Active
* Read Infotype 1
rp-provide-from-last p0001 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* check if employee belongs to PL03
check p0001-werks in pnpwerks. "belongs to PL03
* Check if emp belongs to Active Group
check p0001-persg in pnppersg.
* Read Infotype 2
rp-provide-from-last p0002 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* Read Org Unit Text.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
EXPORTING
OTYPE = 'O'
objid = p0001-orgeh
begda = p0001-begda
endda = p0001-endda
reference_date = p0001-begda
IMPORTING
object_text = o_stext
EXCEPTIONS
nothing_found = 1
wrong_objecttype = 2
missing_costcenter_data = 3
missing_object_id = 4
OTHERS = 5.
*Read Position Text.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
EXPORTING
OTYPE = 'S'
objid = p0001-plans
begda = p0001-begda
endda = p0001-endda
reference_date = p0001-begda
IMPORTING
object_text = p_stext
EXCEPTIONS
nothing_found = 1
wrong_objecttype = 2
missing_costcenter_data = 3
missing_object_id = 4
OTHERS = 5.
* Gather all the required information related to the emp
move: pernr-pernr to t_output-pernr,
o_stext to t_output-orgeh_stext,
p_stext to t_output-plans_stext,
p0002-nachn to t_output-nachn,
p0002-vorna to t_output-vorna.
* Gather previous Employee details
loop at p0023.
move-corresponding p0023 to t_output.
append t_output.
endloop.
*eject
*& End-of Selection *
end-of-selection.
perform print_report.
* Downlaod the file
if not t_output[] is initial.
if p_test eq space.
perform download_file.
endif.
else.
write: 'No records selected' color col_negative.
endif.
*eject
*& Top-of-page *
Top-of-page.
* Print Header
perform print_header.
*eject
*& Form download_file
* Description :
FORM download_file .
DATA: full_file_name TYPE string,
z_akt_filesize TYPE i .
full_file_name = p_file.
* download table into file on presentation server
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = full_file_name
filetype = 'DAT'
NO_AUTH_CHECK = c_x
codepage = '1160'
IMPORTING
FILELENGTH = z_akt_filesize
CHANGING
data_tab = t_output[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
IF sy-subrc NE 0.
MESSAGE e016 WITH 'Download-Error; RC:' sy-subrc.
ENDIF.
ENDFORM. " download_file
*eject
*& Form print_report
*Description:
FORM print_report .
data: i type i,
w_count type i.
sort t_output.
* Print the report
loop at t_output.
i = sy-tabix mod 2.
if i eq 0.
format color col_normal intensified on.
else.
format color col_normal intensified off.
endif.
write:/1 t_output-pernr ,
10 t_output-vorna(25) ,
35 t_output-nachn(25) ,
61 t_output-orgeh_stext ,
102 t_output-plans_stext ,
143 t_output-begda ,
154 t_output-endda ,
168 t_output-land1 ,
178 t_output-arbgb(40) ,
219 t_output-ort01 ,
249 space .
endloop.
uline.
Describe table t_output lines w_count.
Skip 2.
Write:/ 'Total No of Records Downloaded: ' color col_total,
w_count.
ENDFORM. " print_report
*eject
*& Form print_header
*Description:
FORM print_header .
skip 1.
Uline.
format Intensified on color col_heading.
write:/1 'Pers. #' ,
10 'Last Name' ,
35 'First Name' ,
61 'Org Unit' ,
102 'Position' ,
143 'Beg Date' ,
154 'End Date' ,
168 'Cntry Key' ,
178 'Prev Employer' ,
219 'City' ,
249 space .
format intensified off color off.
uline.
ENDFORM. " print_header
*eject
*& Form init_selction_screen
*Description:
FORM init_selction_screen .
refresh: pnpwerks,
pnppersg,
pnpstat2.
clear: pnpwerks,
pnppersg,
pnpstat2.
pnpwerks-sign = c_i.
pnpwerks-option = c_EQ.
pnpwerks-low = c_pl03.
append pnpwerks.
pnppersg-sign = c_i.
pnppersg-option = c_EQ.
pnppersg-low = c_1.
append pnppersg.
pnpstat2-sign = c_i.
pnpstat2-option = c_EQ.
pnpstat2-low = c_3.
append pnpstat2.
ENDFORM. " init_selction_screen -
Problem with PNP customized selection screen
Hi guys,
I have done a report in R/3 system using logical database PNP with customized selection screen. i have 3 parameters as below:
1. radiobutton1 group a for current period,
2. radiobutton2 group a for other period.
3. personnel number.
my program works fine in R/3 but not in my portal. i think it couldn't recognize my radiobutton in my customized screen. whichever radiobutton i selected also it would return current month records.
any idea how to fix this?
any configuration that i can do?
thanks.try testing it through ITS first.
in order to do so . Go to sicf transaction and run webgui. Then run the application using the tcode. Check the results.
Seems wrong paramter are getting passed to the SAP system.
Your ITS server should be activated first in order to use webgui otherwise you will be getting dump.
Regards
Atul Shrivastava -
Problem with user defined selection-screens
Hi,
in my case, i have a default selection screen and a user defined selection screen. Now, after selecting a radio button in default selection screen, the user defined selection screen is called. after executing it report output is displayed. now if i press f3 (back) it is going to default selection screen. here my requirement is, when i press f3 it should go to the user defined selection.
Can u plz help me solve this.
bye n regards
sreeAny modifications to screen 1000 will be lost the next time the program is generated.
When the user hits the back key from the report output, your ABAP is restarted just like when you originally started it. That is why you are getting the default selection screen again.
Use the AT USER-COMMAND event. When BACK is hit from the report, use the SUBMIT command to re-execute the program, passing it the selections from the default selection screen. Leave out the RETURN option.
For help on filling the selection screen during SUBMIT, help is available at
http://help.sap.com/saphelp_470/helpdata/en/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm -
Problem with logic at-selection screen
Hi ,
I have this piece of code :
I have 3 radiobuttons and corresponding screens and fields like r_matnr s_charge etc on that screen .
default radio button is r_build .
a) If on this screen is user forgots to give value for s_matnr then error is given .
now if we click on r_conf the contents of display screen when r_buld was pressed should be gone ..
the r_matnr , r_werks etc . should be blank .
what i should do to implement it ? also validation of point a) should be performed for the current values of that screen .
plz help..
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: r_build RADIOBUTTON GROUP r1 USER-COMMAND act DEFAULT 'X'.
PARAMETERS: r_conf RADIOBUTTON GROUP r1.
SELECTION-SCREEN BEGIN OF LINE.
SELECT-OPTIONS : s_matnr FOR mara-matnr MODIF ID c.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECT-OPTIONS : s_charg FOR mch1-charg MODIF ID c.
SELECTION-SCREEN END OF LINE.
LOOP AT SCREEN.
IF r_conf = 'X'.
IF screen-group1 = 'A'.
screen-active = 0.
ENDIF.
ELSE.
IF r_rel = 'X'.
IF screen-group1 = 'A' OR screen-group1 = 'B'
OR screen-group1 = 'C'.
screen-active = 0.
ENDIF.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN ON s_matnr.
IF s_matnr IS NOT INITIAL.
some select where = s_matnr .
MESSAGE e019(zesapp).
LEAVE TO SCREEN 0.
ENDIF.
plz help..
Regards .hi ujjwal,
can you please elaborate on "the values are getting blank just after entering it ."...
you mean material number gets blank after you enter the value?
also in the below code you are checking material number NOT INITIAL that means some value is entered and if it does not satisfy the SELECT condition then it will give error message and navigate u again to your initial screen...maybe this could be the reason for the blank values...
AT SELECTION-SCREEN ON s_matnr.
IF s_matnr IS NOT INITIAL.
some select where = s_matnr .
MESSAGE e019(zesapp).
LEAVE TO SCREEN 0.
ENDIF.
hope this is helpful. -
Problem with validation of selection screen
I am creating session process for BDC
For that i am taking the flat file at runtime.i want check whether the entered file is valid or not..that means it exists are not?
how to do that..Hi,
DATA: W_FILENAME TYPE STRING,
W_RESULT TYPE C.
W_FILENAME = WK_DIRECTRY.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 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.
IF W_RESULT IS INITIAL.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
EXPORTING
DIRECTORY = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
IF SY-SUBRC 0.
ENDIF.
ENDIF.
IF W_RESULT = 'X'.
RC = '1'.
ELSE.
RC = '0'.
ENDIF.
Regards,
nagaraj -
Problem in enabling the selection screen
Hi ,
I have problem in enabling the selection screen.
i have radio button and based on the radio button i need to make the date field as mandatory.
When i tried this with at selection screen on radio button group XXX, itu2019s not triggering.
Could you please help me by resolving the above problem?
VijayHi,
see the sap documentation
... RADIOBUTTON GROUP group [USER-COMMAND fcode]
Effect:
This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is "X" or "x". Otherwise, it is not selected.
group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.
The parameter must be specified with the type c and length 1. Explicit length specification using len is not permitted. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type
In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be "X". By default, the first parameter in a radio button group is set to the value "X", and the rest are set to " ".
The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.
Note:
It is recommended to define the radio buttons of a radio button group directly underneath each other. If the selection screen also contains other elements, it is recommended to define each radio button group within a block surrounded by a frame.
Regards,
Venkatesh -
Problems With CURSORS in PRO*C
Hi all,
I have a problem with cursors in proc
1. Can i declare a cursor and with in it another cursor in proc
like
EXEC SQL DECLARE emp_cursor CURSOR FOR
SELECT ........;
EXEC SQL OPEN emp_cursor;
for(;;)
EXEC SQL FETCH emp_cursor INTO :emp_structure;
EXEC SQL DECLARE dept_cursor FOR
SELECT ...............;
EXEC SQL OPEN dept_cursor;
for(;;)
EXEC SQL FETCH dept_cursor INTO :dept_structure;
EXEC SQL CLOSE dept_cursor;
EXEC SQL CLOSE emp_cursor;
2. im getting the following error after getting an result
ORA-01405: fetched column value is NULL
though i dont have any null columns.
please help me in this regard,
Thanks in Advance,
Trinath Somanchi,
Hyderabad.
nullUse Indicator variables and let me know if it solves your problem.
http://docs.jcu.edu.au/oracle/doc/server.804/a58233/dev.htm#2239 -
F-32 : Problem with Open Item selection
Hi,
We have a strange problem with open Item selection for customer clearing in t-code F-32
In My QA system
if I input spl GL indicator ="*" and uncheck Normal OI tick,
the system selects all open items,
(those with spl GL indicator and those without spl GL indicator)
In My Dev system
If I input spl GL indicator ="*" and uncheck Normal OI tick
the system does not select any open items,
Please let me know which setting controls this behaviour ?
Regards
SachinHello,
Check your data in FBL5N for the option "Special GL Transactions". There could be that there is no data in the system with SPECIAL GL TRANSACTIONS.
In F-32, there is no value like *
You need to input right Special GL Indicator. "*" will not work here.
I am sure in both the systems if you put "*" and UNTICK your normal transaction, you will NOT get any items to clear.
Please DOUBLE CHECK whether you have unticked normal transaction.
Regards,
Ravi -
I have problems with office for mac screen resolution, specially with excel
I have problems with office for mac screen resolution, specially with excel ?
For starters, make sure to Check for Updates on any of the Help menus, and make sure the product has all the latest patches. MS did come out with a patch addressing the display issues on Retina Macs. Latest patchlevel is 14.3.2.
We are talking about Office:Mac 2011, right? -
Including User selection criteria along with LDB standard selection screen
Hi
While creating a HR report, along with the standard selection screen, if the cusomer requires some more fields to be added, How to retrive the data from the DB?
Is it the way to retrive the data based on Standard selection criteria from the LDB and then filter it based on user criteria or any other way?
Please help me out in this regard.
Thank you.Yes thats the way. You get the data based on Selection screen of LDB (You can select Report Catogory you wish to) once you get data, You can put CHECK statement to see the data against PXXXX type to the filter value from you custom field on selection screen.
-
Problem with MAIL, when select names that start with "E" the mail freeze. Can't fix it.
Now I checked the materials that I got from AT&T Yahoo and
port 25 is used as the outgoing mail port, 110 for incoming.
This is for the POP type account provided by AT&T, not necessarily for an email account and SMTP server not provided by AT&T.
Sounds like AT&T blocks using an SMTP server that is outside of their network or not provided by AT&T on Port 25.
Try the following first.
Go to Mail > Preferences > Accounts and under the Account Information tab for your .Mac account preferences at the SMTP server selection, select the Server Settings button below for the .Mac SMTP server.
Enter 587 in place of 25 in the Server Port field and when finished, select OK to save the changed setting.
If this doesn't work, we will go to plan B. -
Problem with align and Selection Tool.
This is a weird problem which I cannot explain at all.
I am using AI CS3 with Windows XP.
I am having this completely random problem with the selection tool and align pallette I cannot explain.
I have a group of objects and groups of objects I am trying to use the align pallette on.
Sometimes when I select all of the items I want to align, either by shift-clicking each one, or by drag-selecting them I am getting a random behavior where sometimes the align button will move all of the objects COMPLETELY off of the artboard, all the way to the edge of the working area and beyond into the grey area you cannot see.
Normally, this would be caused by a stray point somewhere way off-screen or some other cleanup oriented thing on my part. However in this case, the behavior is random and does not happen every time I hit the align button.
Sometimes it takes items within my grouped objects (lines of text) and moves THEM completely off the work area, leaving the other items in the groups in place. Sometimes the bounding box when I drag-select the items will stretch extremely far off of the work area.
I have even dragged the extra large bounding box, bringing the edge that was once way off screen onto the work area, in outline view, in hopes of finding the stray point or object that could be causing this. However NOTHING appears that can be causing the align to throw all of my objects off-screen.
The random nature of this behavior and the way it sometimes affects my text objects inside of groups leads me to believe it is a program bug and nothing I am doing.
The behavior takes place regardless if I select by dragging or by shift-clicking, and is happening in more than one file, also randomly.
Also, choosing "align to art board" vs. "align to crop area" does nothing to change this behavior.
It is quite irritating. I've been using illustrator since v.88 so I have enough experience to know this is not normal.
Any help with this one would be greatly appreciated.When this behaviour occurs, are perhaps guides included in your selection?
-
Problem with ALV Grid Display screen Back Button
Dear Friends ,
I have an ALV Grid Display,Here am facing a problem for my 'Back' button,i haven't defined any PF Status and is using the standard one.But after the Display when i press Back Button a blank Screen is appearing n then again i have to press back button to go to my Selection Screen.
Please Suggest if i have to take care of something else.
I want my Selection Screen when i press Back on my Display Screen.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
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 = I_LAYOUT
IT_FIELDCAT = IT_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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
Thanks and Regards,
AshwiniHi Vijay ,
No i dont have any write statement in my proggram.
Here it is
REPORT ZRMMPD01A NO STANDARD PAGE HEADING.
TABLES : EQUI,SER03,MKPF,OBJK.
TYPE-POOLS : SLIS.
DATA IT_EQUI LIKE EQUI OCCURS 0 WITH HEADER LINE.
DATA IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE..
DATA IT_SER03 LIKE SER03 OCCURS 0 WITH HEADER LINE.
DATA IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE .
DATA : BEGIN OF IT_DISPLAY OCCURS 0,
MATNR LIKE EQUI-MATNR,
SERNR LIKE EQUI-SERNR,
BWART LIKE SER03-BWART,
WERK LIKE SER03-WERK,
CHARGE LIKE SER03-CHARGE,
LAGERORT LIKE SER03-LAGERORT,
MBLNR LIKE SER03-MBLNR,
MJAHR LIKE SER03-MJAHR,
ZEILE LIKE SER03-ZEILE,
BUDAT LIKE MKPF-BUDAT,
BKTXT LIKE MKPF-BKTXT,
USNAM LIKE MKPF-USNAM,
XBLNR LIKE MKPF-XBLNR,
END OF IT_DISPLAY.
DATA : WA_DISPLAY LIKE IT_DISPLAY.
DATA IT_FINAL LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA IT_TEMP LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA :I_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR EQUI-MATNR MATCHCODE OBJECT MCD,"OBLIGATORY
S_SERNR FOR EQUI-SERNR, "MATCHCODE OBJECT MCD OBLIGATORY
S_MBLNR FOR SER03-MBLNR MATCHCODE OBJECT MCD,
S_BWART FOR SER03-BWART MATCHCODE OBJECT MCD,
S_WERK FOR SER03-WERK MATCHCODE OBJECT MCD,
S_LAGET FOR SER03-LAGERORT MATCHCODE OBJECT MCD,
S_BUDAT FOR MKPF-BUDAT MATCHCODE OBJECT MCD,
S_XBLNR FOR MKPF-XBLNR MATCHCODE OBJECT MCD.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
START-OF-SELECTION.
*Fetch Data.
PERFORM GET_DATA.
*Fill Display Fields.
PERFORM FILL_TABLE.
*Segregate data according to radio button selection.
PERFORM SELECT_CONDITION.
*Fill The Feild catalog.
PERFORM FIELD_CATALOG.
*Display Output.
PERFORM OUTPUT_DISPLAY..
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA.
SELECT * FROM EQUI INTO TABLE IT_EQUI
WHERE MATNR IN S_MATNR
AND SERNR IN S_SERNR.
SELECT * FROM OBJK INTO TABLE IT_OBJK
FOR ALL ENTRIES IN IT_EQUI
WHERE EQUNR = IT_EQUI-EQUNR.
SELECT * FROM SER03 INTO TABLE IT_SER03
FOR ALL ENTRIES IN IT_OBJK
WHERE OBKNR = IT_OBJK-OBKNR
AND MBLNR IN S_MBLNR
AND BWART IN S_BWART
AND WERK IN S_WERK
AND LAGERORT IN S_LAGET.
SELECT * FROM MKPF INTO TABLE IT_MKPF
FOR ALL ENTRIES IN IT_SER03
WHERE MBLNR = IT_SER03-MBLNR
AND BUDAT IN S_BUDAT
AND XBLNR IN S_XBLNR.
ENDFORM. " GET_DATA
*& Form FILL_TABLE
text
--> p1 text
<-- p2 text
FORM FILL_TABLE.
LOOP AT IT_EQUI.
LOOP AT IT_OBJK.
IF IT_OBJK-EQUNR <> IT_EQUI-EQUNR.
SKIP.
ELSE.
READ TABLE IT_SER03 WITH KEY OBKNR = IT_OBJK-OBKNR.
IF SY-SUBRC = 0.
WA_DISPLAY-MATNR = IT_EQUI-MATNR.
WA_DISPLAY-SERNR = IT_EQUI-SERNR.
WA_DISPLAY-BWART = IT_SER03-BWART.
WA_DISPLAY-WERK = IT_SER03-WERK.
WA_DISPLAY-CHARGE = IT_SER03-CHARGE.
WA_DISPLAY-LAGERORT = IT_SER03-LAGERORT.
WA_DISPLAY-MBLNR = IT_SER03-MBLNR.
WA_DISPLAY-MJAHR = IT_SER03-MJAHR.
WA_DISPLAY-ZEILE = IT_SER03-ZEILE.
READ TABLE IT_MKPF WITH KEY MBLNR = IT_SER03-MBLNR.
IF SY-SUBRC = 0.
WA_DISPLAY-BUDAT = IT_MKPF-BUDAT.
WA_DISPLAY-BKTXT = IT_MKPF-BKTXT.
WA_DISPLAY-USNAM = IT_MKPF-USNAM.
WA_DISPLAY-XBLNR = IT_MKPF-XBLNR.
ENDIF.
ENDIF.
ENDIF.
IF NOT WA_DISPLAY IS INITIAL.
APPEND WA_DISPLAY TO IT_DISPLAY.
CLEAR WA_DISPLAY.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. " FILL_TABLE
*& Form FIELD_CATALOG
text
--> p1 text
<-- p2 text
FORM FIELD_CATALOG.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MATNR'.
FIELDCAT-SELTEXT_M = 'Material Number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'SERNR'.
FIELDCAT-SELTEXT_M = 'Serial number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MBLNR'.
FIELDCAT-SELTEXT_L = 'Number of material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BWART'.
FIELDCAT-SELTEXT_M = 'Movement type'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'WERK'.
FIELDCAT-SELTEXT_M = 'Plant'.
FIELDCAT-OUTPUTLEN = 5.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'CHARGE'.
FIELDCAT-SELTEXT_M = 'Batch number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'LAGERORT'.
FIELDCAT-SELTEXT_M = 'Storage Location'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MJAHR'.
FIELDCAT-SELTEXT_M = 'Material doc. year'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'ZEILE'.
FIELDCAT-SELTEXT_L = 'Item in material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BUDAT'.
FIELDCAT-SELTEXT_L = 'Posting date in the document'.
FIELDCAT-OUTPUTLEN = 10.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BKTXT'.
FIELDCAT-SELTEXT_L = 'Document header text'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'USNAM'.
FIELDCAT-SELTEXT_M = 'User name'.
FIELDCAT-OUTPUTLEN = 15.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'XBLNR'.
FIELDCAT-SELTEXT_L = 'Reference document number'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
ENDFORM. " FIELD_CATALOG
*& Form DISPLAY_OUTPUT
text
--> p1 text
<-- p2 text
FORM OUTPUT_DISPLAY.
IF R1 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_DISPLAY
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ELSEIF R2 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_FINAL
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ENDIF.
ENDFORM. " DISPLAY_OUTPUT
*& Form SELECT_CONDITION
text
--> p1 text
<-- p2 text
FORM SELECT_CONDITION.
IF R2 = 'X'.
CLEAR WA_DISPLAY.
SORT IT_DISPLAY BY MATNR SERNR MBLNR ZEILE.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY WHERE ZEILE = '0002'.
READ TABLE IT_DISPLAY WITH KEY MATNR = IT_DISPLAY-MATNR
SERNR = IT_DISPLAY-SERNR ZEILE = '0001'.
IF SY-SUBRC = 0.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
SORT IT_DISPLAY BY MATNR SERNR BWART MBLNR.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY.
IF WA_DISPLAY IS INITIAL.
WA_DISPLAY = IT_DISPLAY.
ENDIF.
LOOP AT IT_DISPLAY WHERE MATNR = WA_DISPLAY-MATNR
AND SERNR = WA_DISPLAY-SERNR.
IF IT_DISPLAY-BUDAT > WA_DISPLAY-BUDAT.
WA_DISPLAY = IT_DISPLAY.
ELSE.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
APPEND WA_DISPLAY TO IT_TEMP.
CLEAR WA_DISPLAY.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM IT_TEMP.
IF NOT IT_TEMP[] IS INITIAL.
IT_FINAL[] = IT_TEMP[].
ENDIF.
ENDIF.
ENDFORM. " SELECT_CONDITION
Regards,
Ashwini -
How to save varaint in a report program with tabstrip in selection-screen
Hi Gurus,
We have a custom report program and selection screen of this program has a tabstrip of 9 tabs. This program will run in background job and we are facing problem to save variant for this report program.
We saved one variant with 'TAB2' populated. But when we execute the report and select that variant and we are not navigated to 'TAB2' automatically. So, code for TAB2 is not triggerd and we are not getting desired output.
When we set this program with variant in Job, program is not navigated to 'TAB2' as per variant setup.
Is there any way to save variant for this kind of report ?
Please help with your suggestions
Thanks & Regards
ChandanThanks for your help.
I found during debugging that it is holding the sy-ucomm of the first tab as default value. So, I declared a new field in selection screen with No-Display option. When user will select a tab, this new field will hold the value of that sy-ucomm. As this field is in selection screen, it is getting stored in variant also.
In start-of-selection of program I am checking this field value and accordingly set the TABSTRIP.
Thanks again for your help.....
Regards,
Chandan
Maybe you are looking for
-
Error while running create_chain
I noticed a strange error while executing create_chain. SQL> BEGIN 2 DBMS_SCHEDULER.CREATE_CHAIN ( 3 chain_name => 'tc1'); 4 END; 5 / BEGIN ERROR at line 1: ORA-24332: invalid object type ORA-06512: at "SYS.DBMS_ISCHED", line 817 ORA-06512: at "SYS.D
-
RFC destination for synchronous communication (message type SYNCH)
Hi experts, I am trying to configuare ALE settings.waht i did is My sending & receiving systems are one server with different clients.By using SALE transaction 1.crated logical systems.(LS_800 &LR_810) 2.Assigned those to clients. 3.Created RFC desti
-
Videos won't play in editing board
When I click on the individual clips in order to watch, cut and edit them...they literally will not PLAY. When I hit the "play" arrow, it switches the "pause" image as if it's playing, but the screen stays frozen. It didn't matter whether I dragged t
-
WM Storage Location control problem - no TR created in receiving warehouse
Hi all, I have configured the system to perform a 311 mvt from sloc 4002 to sloc 0010. Both Slocs have different warehouse numbers assigned. The transfer is working fine, however in the receiving warehouse no TR is being generated even though I am us
-
Hi Pricing experts, I want to use a pricing condition as a basis for other condition value calculation as below. Condition 1: Number of weeks (condition basis) Condition 2: Weekly pay (amount) Condition 3: Weekly pay x number of week (condition 1 x c