Friday, September 6, 2019

WEBDYNPRO TABLE

well, hello again, this time i will teach you how to create a simple yet powerfull webdynpro applications.

all of instructions have been instructed completely on YouTube



and below the Code OF WDDOMODIFYVIEW

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
METHOD wddomodifyview .
  DATA : pa0001 TYPE TABLE OF p0001.
  DATA : p0001 TYPE  p0001.
   DATA lo_nd_data TYPE REF TO if_wd_context_node.

   DATA lo_el_data TYPE REF TO if_wd_context_element.
   DATA ls_data TYPE wd_this->element_data.
   DATA lt_data TYPE TABLE OF wd_this->element_data.

   lo_nd_data = wd_context->get_child_node( name = wd_this->wdctx_data ).
 DATA OBJECT_TEXT TYPE P1000-STEXT.
  DATA: "BEGIN OF VACANCIES OCCURS 5,
       vac_objid type t750x-objid,
       vac_endda type t750x-endda,
       vac_begda type t750x-begda,
       vac_statu type t750x-statu,
       vac_stext type hrp1000-stext                         "KVHN875886
    .
  DATA   :
         lt_t750b TYPE TABLE OF t750b,
         lt_t750a TYPE TABLE OF t750a,
         lt_t750x TYPE TABLE OF t750x,
         lx_t750x TYPE t750x,
         lx_t750a TYPE t750a,
         lx_t750C TYPE t750c,
         lx_t750b TYPE t750b.
  SELECT * FROM t750b INTO TABLE lt_t750b
    WHERE rcins = '3'.

  SELECT SINGLE * FROM T750C INTO lx_t750C WHERE RCINS EQ '3'.

  CHECK lt_t750b IS NOT INITIAL.
  SELECT * FROM t750a INTO TABLE lt_t750a
    FOR ALL ENTRIES IN lt_t750b
    WHERE offid EQ lt_t750b-offid .


  LOOP AT lt_t750b INTO lx_t750b.
    READ TABLE lt_t750a INTO lx_t750a WITH KEY offid = lx_t750b-offid.
    CHECK sy-subrc IS INITIAL.
    SELECT SINGLE * FROM t750x  INTO lx_t750x
         WHERE otype EQ lx_t750a-otype
                        AND objid EQ lx_t750a-objid
*                            AND BEGDA LE T750B-PBDAT       "LAK1540862
                        AND endda GE lx_t750b-pbdat .     "XDPK0

        vac_endda = lx_t750x-ENDDA.
        vac_begda = lx_t750x-BEGDA.
        vac_objid = lx_t750a-OBJID.

    CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'             "XDPK011277
       EXPORTING                                            "XDPK011277
            otype                   = 'S'                   "XDPK011277
            objid                   = vac_objid             "XDPK011277
            begda                   = vac_begda             "XDPK011277
*            ENDDA                =       "XDPK011277
            endda                   = vac_endda
       IMPORTING                                            "XDPK011277
            object_text             = object_text           "XDPK011277
       EXCEPTIONS                                           "XDPK011277
            nothing_found           = 1                     "XDPK011277
            wrong_objecttype        = 2                     "XDPK011277
            missing_costcenter_data = 3                     "XDPK011277
            missing_object_id       = 4                     "XDPK011277
            OTHERS                  = 5.

    ls_data-begda = lx_t750x-begda.
    ls_data-endda = lx_t750x-endda.
    ls_data-offid = lx_t750b-offid.
    ls_data-position_c = object_text."lx_t750c-iname.
    ls_data-position_n = space.

    REFRESH pa0001.
            CALL FUNCTION 'HR_READ_INFOTYPE'
              EXPORTING
                TCLAS                 = 'A'
                PERNR                 = lx_t750x-respo
                INFTY                 = '0001'
                BEGDA                 = lx_t750x-begda
                ENDDA                 = lx_t750x-endda
*               BYPASS_BUFFER         = ' '
*               IMPORTING
*               SUBRC                 =
              TABLES
                INFTY_TAB             = pa0001
              EXCEPTIONS
                INFTY_NOT_FOUND       = 1
                OTHERS                = 2
                      .
    READ TABLE pa0001 INTO p0001 WITH KEY endda = '99991231'.
    CHECK sy-subrc IS INITIAL.
    ls_data-line_n = p0001-pernr.
    ls_data-line_c = p0001-ename.
    append ls_data to lt_data.
  ENDLOOP.

  lo_nd_data->bind_table(
    EXPORTING
      new_items            = lt_data    " List of Elements or Model Data
*      set_initial_elements = ABAP_TRUE    " If TRUE, Set Initial Elements Otherwise Add
*      index                =     " Index of Context Element
  ).
ENDMETHOD.





Instagram : https://www.instagram.com/thered_beard/
YouTube   : TheRed_Beard