cancel
Showing results for 
Search instead for 
Did you mean: 

date format in script text eidtor

kiran_k8
Active Contributor
0 Kudos

In the script text editor if I have to give Less than equal to sep 22nd 2010,

should I follow like

IF &EKKO-BEDAT& LE 09/22/2010 or

IF &EKKO-BEDAT& LE 22/09/2010 or

IF &EKKO-BEDAT& LE 22092010 or

IF &EKKO-BEDAT& LE 09222010 or

IF &EKKO-BEDAT& LE '22.09.2010'.

In the table it is getting stored as 09/22/2010 ie sep 10th 2010.In Script debugging it is showing as 22.09.2010.

Thanks,

K.Kiran.

Accepted Solutions (1)

Accepted Solutions (1)

kesavadas_thekkillath
Active Contributor
0 Kudos

There may be a work around for this

Why cant you place these conditions in your program and check it here lke in your program

IF EKKO-BEDAT LE 09/22/2010 or

flag = 'A'.

endif.

IF EKKO-BEDAT LE 22/09/2010 or

flag = 'B'.

endif.

in form check it like

if &flag& = 'A'....

in your program before harcoding the date , get the user settings date format and convert it before comparing.

Answers (3)

Answers (3)

Former Member
0 Kudos

what about declaring a dummy date variable lobally in driver program? you could fill it somewhere there and then in form just do following:

/: IF &EKKO-BEDAT& LE &DUMMY_DATE&

Former Member
0 Kudos

Hi Kiran,

You could try declaring a form in a subroutine pool to accept the EKKO-BEDAT field and to perform your test there, setting a flag and returning that back to the SAPScript for testing.

Something like:


(SAPScript)
/: DEFINE &FLAG& = ' '
/: PERFORM DATE_TEST IN PROGRAM Z_SUBROUTINE_POOL
/: USING &EKKO-BEDAT&
/: CHANGING &FLAG&
/: ENDPERFORM
/: IF &FLAG& = 'X'
   ....
/: ELSE
   ....
/: ENDIF

ABAP (in program/subroutine pool Z_SUBROUTINE_POOL)


FORM DATE_TEST TABLES T_IN STRUCTURE ITCSY
T_OUT STRUCTURE ITCSY.

  DATA: L_BEDAT    TYPE D.

  LOOP AT T_IN.
    IF T_IN-NAME = 'ÉKKO-BEDAT'.
      L_BEDAT = T_IN-VALUE.
    ENDIF
  ENDLOOP.

* Assumes that EKKO-BEDAT is passed in YYYYMMDD format

  LOOP AT T_OUT.
    IF T_OUT-NAME = 'FLAG'.
      IF L_BEDAT LE '20100922'.
        T_OUT-VALUE = 'X'.
      ELSE.
        T_OUT-VALUE = SPACE.
      ENDIF.
    ENDIF.
    MODIFY T_OUT.
  ENDLOOP.

ENDFORM.

Apologies if there are any syntax errors here!

Regards, Andy

Former Member
0 Kudos

Hi kiran,

Try like this

IF F &EKKO-BEDAT& LE '20100922' i.e, YYYYMMDD

Regards,

Jagadeesh T.