Skip to Content
0

how to use wildcards in "between" condition (webdynpro).

Nov 03, 2016 at 09:32 AM

34

avatar image

Hi all,

I'm trying to write an if condition using values from some input fields (a string and four timestamps ). I'd like to use wildcards when some of this values are empty (not choosen by the user) by I don't know how to put this wildcard in the condition (particularly with "between" keyword).

I made it in a wrong way, but I post my code to make my question more understandable.

  DATA: lt_tab             TYPE STANDARD TABLE OF wd_this->element_node_tab,
        ls_tab             LIKE LINE OF lt_tab,
        lt_alvtab          TYPE STANDARD TABLE OF wd_this->element_node_alv,
        ls_form            TYPE wd_this->element_node_form,
        ls_uplfrom_tstamp  TYPE tzonref-tstamps,
        ls_uplto_tstamp    TYPE tzonref-tstamps,
        ls_signfrom_tstamp TYPE tzonref-tstamps,
        ls_signto_tstamp   TYPE tzonref-tstamps.

  wd_context->get_child_node( name = 'NODE_TAB' )->get_static_attributes_table( IMPORTING table = lt_tab ).

  wd_context->get_child_node( name = 'NODE_FORM' )->get_static_attributes( IMPORTING static_attributes = ls_form ).

  IF ls_form IS INITIAL.
    wd_this->onactionview_all( wdevent ).
  ELSE.
    IF ls_form-ordnum IS INITIAL.
      ls_form-ordnum = '%'.
    ENDIF.

    IF ls_form-signfrom IS INITIAL.
      ls_signfrom_tstamp = '%'.
    ELSE.
      CALL FUNCTION 'CONVERT_INTO_TIMESTAMP'
        EXPORTING
          i_datlo     = ls_form-signfrom
          i_timlo     = '000000'
        IMPORTING
          e_timestamp = ls_signfrom_tstamp.
    ENDIF.

    IF ls_form-signto IS INITIAL.
      ls_signto_tstamp = '%'.
    ELSE.
      CALL FUNCTION 'CONVERT_INTO_TIMESTAMP'
        EXPORTING
          i_datlo     = ls_form-signto
          i_timlo     = '235959'
        IMPORTING
          e_timestamp = ls_signto_tstamp.
    ENDIF.

    IF ls_form-uplfrom IS INITIAL.
      ls_uplfrom_tstamp = '%'.
    ELSE.
      CALL FUNCTION 'CONVERT_INTO_TIMESTAMP'
        EXPORTING
          i_datlo     = ls_form-uplfrom
          i_timlo     = '000000'
        IMPORTING
          e_timestamp = ls_uplfrom_tstamp.
    ENDIF.

    IF ls_form-uplto IS INITIAL.
      ls_uplto_tstamp = '%'.
    ELSE.
      CALL FUNCTION 'CONVERT_INTO_TIMESTAMP'
        EXPORTING
          i_datlo     = ls_form-uplto
          i_timlo     = '235959'
        IMPORTING
          e_timestamp = ls_uplto_tstamp.
    ENDIF.

    LOOP AT lt_tab INTO ls_tab.


" this is the if condition I'd like to use


      IF ls_tab-object_id EQ ls_form-ordnum AND ls_tab-pdf_upload_date BETWEEN ls_uplfrom_tstamp AND ls_uplto_tstamp AND ls_tab-pdf_signature_date BETWEEN ls_uplfrom_tstamp AND ls_uplto_tstamp.

        APPEND ls_tab TO lt_alvtab.
      ENDIF.
    ENDLOOP.
  ENDIF.

  wd_context->get_child_node( 'NODE_ALV' )->bind_table( lt_alvtab ).
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers