Skip to Content

Error parameter type sy--datum

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>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Feb 27, 2007 at 05: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 05:27 AM

    instead of USING, use TABLES .

    it will solve ur problem.

    Sujatha.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 10:22 PM

    Hi,

    You have declared the select-options as p_date. Pls check.

    Regards

    Subramanian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 26, 2007 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.