‎2014 Jul 31 1:21 PM
Dear ALL,
Being new to ABAP, I am struck in a Problem.
Requirement:
I want an option on the Screen( My Screen 9000) for Date Range. Through this Date-Range I want to filter and pull some data from
Database.
As Date Range Selection option is possible only through Sub-Screen integration. Hence I integrated a Sub-Screen 400 (as below) and named the Sub-Screen area as SEL on my screen.
Problem: As soon as I enter the dates on the screen, then those dates are not taken up by the code.
During debugging I saw the the S_datum-low and S_datum-high are empty (in fact 00000000)
The code follows:
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
Call SUBSCREEN SEL INCLUDING sy-repid '400'.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.
**********************************************************************************************
DATA: gv_datum Type dats,
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS: s_datum FOR gv_datum.
SELECTION-SCREEN END OF SCREEN 400 .
Plz help where I am missing something.
Regards
Chandan
‎2014 Jul 31 3:06 PM
Call the subscreen during the AT SELECTION-SCREEN event.
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS: s_datum FOR gv_datum.
SELECTION-SCREEN END OF SCREEN 400 .
AT SELECTION-SCREEN.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS '0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
‎2014 Jul 31 3:06 PM
Call the subscreen during the AT SELECTION-SCREEN event.
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS: s_datum FOR gv_datum.
SELECTION-SCREEN END OF SCREEN 400 .
AT SELECTION-SCREEN.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS '0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
‎2014 Jul 31 3:15 PM
Dear Aaron,
Thanks for ur reply.
What do u mean by this : "Call the subscreen during the AT SELECTION-SCREEN event.".
But "At SELECTION-SCREEN" event you are calling Screen 100. and not the sub-screen (Screen 400)
AT SELECTION-SCREEN.
CALL SCREEN 100.
Regards
Chandan
‎2014 Jul 31 3:17 PM
Yes, I apologize. I should have said to call the screen not subscreen.
‎2014 Jul 31 3:19 PM
Hi,
Ok I understood and tried that, but it doesn't works. still in debugging s_datum-low and s_datum-high are 00000000 .
Any more ideas!
Regards
Chandan
‎2014 Jul 31 3:20 PM
Can you paste all of your code? I have what I pasted above in a test program and it works.
‎2014 Jul 31 3:24 PM
Oh, I see the difference. In my test program I defined S_BUDAT as seen below.
TABLES: vbak.
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS: s_datum FOR vbak-erdat.
SELECTION-SCREEN END OF SCREEN 400 .
‎2014 Jul 31 3:28 PM
Hi,
As for practice I am using minsap version of ABAP so in this version vbak table is not available. Hence I can't use the above table in my code.
Regards
Chandan
‎2014 Jul 31 3:30 PM
‎2014 Jul 31 3:34 PM
Hi,
Thanks. I have SFLIGH table in my version. So the field SFLIGHT-FDATE would work?
Regards
Chandan
‎2014 Jul 31 3:38 PM
Hi,
No I tries SFLIGHT-FLDATE. It doesn't works.
My code is too long. I can post it if you want. and highlight the syntaxes that we need in BOLD.
Regards
‎2014 Jul 31 5:37 PM
Hi chandan,
You said in MPP the entered date values become 000000. so first you have to capture the entered screen values using this function module 'DYNP_VALUES_READ'. because you use SELECT-OPTION for date field. so you can use this function module (PROCESS ON VALUE REQUEST FOR ...............) to capture the entered date-low and date-high .
‎2014 Jul 31 3:43 PM
Hi Chandan.
You can try to add this line in your PAI 9000... and check if work correctly..
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
Call SUBSCREEN SEL INCLUDING sy-repid '400'.
*
PROCESS AFTER INPUT.
Call SUBSCREEN SEL
MODULE USER_COMMAND_9000.
Regards.
‎2014 Jul 31 3:46 PM
Ah, that must be what he is missing. I have that in my screen and forgot to mention it.
‎2014 Jul 31 3:53 PM
Hi Loscos,
Thanks.
You are right. After I introduced :
CALL SUBSCREEN SEL in PAI of LOGIC of the screen, what I see in debugging mode that
S_datum-low and S_datum-high are populated but my main progg. of Screen 9000 doesn't gets executed. Even the back arrow doesn't works.
Something more seems missing to enabale execution of code of Screen 9000.
Regards
Chandan
‎2014 Jul 31 4:06 PM
This link may be help you to resolve the problem...
http://help.sap.com/saphelp_470/helpdata/es/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
Regards !!