02-26-2007 10:19 PM
i got a block with 2 parameters like this:
<i>SELECTION-SCREEN BEGIN OF block 1 WITH FRAME TITLE text-001.
PARAMETERS: p_chkb AS CHECKBOX.
SELECT-OPTIONS: p_date FOR sy-datum.
SELECTION-SCREEN END OF block 1.</i>
in my main programa i want to make a perform like this
<i>IF p_chkb NE SPACE.
PERFORM form_xxx USING p_date.
ENDIF.
</i>
but when i define the <i>form_xxx</i> i got this error:
<i>FORM form_xxx USING s_date TYPE sy-datum.
READ TABLE s_date INDEX 1.
IF sy-subrc NE 0.
message 'Please insert the date field' TYPE 'I'.
ELSE.
...
...
...
ENDIF.
ENDFORM.
</i>
<b>"S_DATE" is neither specified under "TABLES" nor is it defined as an internal table</b>
02-26-2007 11:24 PM
Hi,
Check this example..
SELECT-OPTIONS: so_date FOR sy-datum.
AT SELECTION-SCREEN.
IF so_date[] IS INITIAL.
MESSAGE e208(00) WITH 'Date is required'.
ENDIF.
START-OF-SELECTION.
PERFORM select_data USING so_date[].
----
FORM select_data *
----
........ *
----
--> LT_DATE *
----
FORM select_data USING lt_date LIKE so_date[].
DATA lt_vbak TYPE TABLE OF vbak.
SELECT * FROM vbak INTO TABLE lt_vbak
WHERE erdat IN lt_date[].
WRITE: / sy-subrc.
ENDFORM.
Thanks,
Naren
02-26-2007 10:22 PM
Hi,
You have declared the select-options as p_date. Pls check.
Regards
Subramanian
02-26-2007 10:26 PM
yes i know and that's the one that i'm using when i call the form_xxx but inside the form_xxx i have to use the s_date
02-26-2007 10:26 PM
Double clike the perform and it will create the routine with the name p_s_date.
Thanks,
Santosh
Message was edited by:
SKJ
02-26-2007 10:34 PM
1. It create's the routine but without type of the paramenter.
2. I try to use de 'IS INITIAL' but it gave me the error in here:
SELECT docsap ref sum( subtotal ) sum( iva )
FROM zcmtt_envase
INTO TABLE ti_zcmtt_envase
WHERE docsap = s_tipo
AND fecha IN s_date <------ERROR
AND estado NE ''
GROUP BY docsap ref.
Mensaje editado por:
Sergio Cifuentes
02-26-2007 10:26 PM
Hi,
Delete your FORM ...ENDFORM declaration. Double click on form_XXX in the PERFORM stmt. SAP will generate the appropriate FORM...ENDFORM strcuture for you. Then write the lines in between.
If you are using ECC 6.0 and the code checker asks for type of the parameter, give TYPE ANY.
Regards
Subramanian
02-26-2007 10:27 PM
Hello,
SELECTION-SCREEN BEGIN OF block 1 WITH FRAME TITLE text-001.
PARAMETERS: p_chkb AS CHECKBOX.
<b>SELECT-OPTIONS: p_date FOR sy-datum.</b>
SELECTION-SCREEN END OF block 1.
Change this to
PARAMETERS P_DATE LIKE SY-DATUM.
If u want to use it as Select-options then.
RANHES RA_DATUM TYPE SY-DATUM
<b>FORM XXX TABLES S_DATE STRUCTURE RA_DATUM</b>
Vasanth
Message was edited by:
Vasanth M
02-26-2007 10:30 PM
Hi,
You cannot do read table in the FORM since your parameter there is not of table type but of type SY-DATUM which is single element and not table.
instead if you pass in PERFORM
PERFORM form_xxx USING p_date-low.
and remove READ TABLE, code will run fine or declare s_date as type equivalent to p_date or remove USING if you are wriing the code in the same report without using Includes.
Regards,
Amit
Reward all helpful replies.
02-26-2007 10:33 PM
Hi,
Looks like you are checking for date to be filled.
Change the stmt like:
FORM form_xxx USING s_date .
READ TABLE s_date INDEX 1.
<b>IF s_date is initial.</b>
message 'Please insert the date field' TYPE 'I'.
ELSE.
...
...
...
ENDIF.
ENDFORM.
Regards
Subramanian
02-26-2007 10:51 PM
Hi,
Use the body operator if you didn't give the structure in the subroutine parameters..
Changes marked in bold..
SELECT docsap ref sum( subtotal ) sum( iva )
FROM zcmtt_envase
INTO TABLE ti_zcmtt_envase
WHERE docsap = s_tipo
AND fecha IN s_date<b>[ ]</b>
AND estado NE ''
GROUP BY docsap ref.
Thanks,
Naren
02-26-2007 11:05 PM
it doesn't work with the '[]', maybe if i tell you what i want, i need a screen with 2 parameter 1 checkbox and the other it has to be a range of date, i mean from date to date, then if the checkbox it's checked i need to send the date variable in a parameter and in the form i have to use this parameter (date) to make a select.
Thanks,
Sergio
Mensaje editado por:
Sergio Cifuentes
02-26-2007 11:24 PM
Hi,
Check this example..
SELECT-OPTIONS: so_date FOR sy-datum.
AT SELECTION-SCREEN.
IF so_date[] IS INITIAL.
MESSAGE e208(00) WITH 'Date is required'.
ENDIF.
START-OF-SELECTION.
PERFORM select_data USING so_date[].
----
FORM select_data *
----
........ *
----
--> LT_DATE *
----
FORM select_data USING lt_date LIKE so_date[].
DATA lt_vbak TYPE TABLE OF vbak.
SELECT * FROM vbak INTO TABLE lt_vbak
WHERE erdat IN lt_date[].
WRITE: / sy-subrc.
ENDFORM.
Thanks,
Naren
02-27-2007 5:12 AM
Hi,
U can write as belwo:
SELECTION-SCREEN BEGIN OF block 1 WITH FRAME TITLE text-001.
PARAMETERS: p_chkb AS CHECKBOX.
SELECT-OPTIONS: p_date FOR sy-datum OBLIGATORY.
SELECTION-SCREEN END OF block 1.
* AT SELECTION SCREEN ON p_date.
START-OF-SELECTION.
IF NOT p_chkb IS INITIAL.
PERFORM form_xxx.
ENDIF.
FORM form_xxx.
IF NOT p_date IS INITIAL.
SELECT docsap ref sum( subtotal ) sum( iva )
FROM zcmtt_envase
INTO TABLE ti_zcmtt_envase
WHERE docsap = s_tipo
AND fecha IN p_date
AND estado NE ''
GROUP BY docsap ref.
ENDIF.
ENDFORM.
Hope this will solve ur problem.
Reward if this helps.
02-27-2007 5:27 AM