Skip to Content

After enhancing 0FI_GL_10 via BAdi the enhanced column is not populated

Hi Experts

After enhancing 0FI_GL_10 via BAdi the enhanced column(TimeStamp) is not populated.

Reference PDF:

BADI enhance datasources in ECC

Abap Code :


SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

METHOD M_0FI_GL_10.



*declaring a field symbol with type of extract structure of 0FI_GL_10

FIELD-SYMBOLS: <L_S_DATA> TYPE FAGL_EXTSTRUCT_LEAD.



*declare a structure with field required from FAGLFLEXT table

TYPES : BEGIN OF IT_FAGLFLEXT,

V_TIMESTAMP TYPE TIMESTAMP,

END OF IT_FAGLFLEXT.



*Declare an internal table and work area with above type

DATA : ZBW_FAGLFLEXT TYPE STANDARD TABLE OF IT_FAGLFLEXT,

  L_T_DATA TYPE STANDARD TABLE OF FAGL_EXTSTRUCT_LEAD, "internal table same as C_T_DATA

  WA_FAGLFLEXT TYPE IT_FAGLFLEXT.



*move the entire content into another internal table

L_T_DATA[] = C_T_DATA[].

IF NOT L_T_DATA IS INITIAL.

*Read the fields from FAGLFLEXT table for all entries of L_T_DATA and put them in to IT_FAGLFLEXT

SELECT TIMESTAMP OBJNR00 OBJNR01 OBJNR02 OBJNR03 DRCRK

FROM  FAGLFLEXT INTO TABLE ZBW_FAGLFLEXT

FOR ALL ENTRIES IN L_T_DATA

WHERE RYEAR EQ L_T_DATA-RYEAR AND

OBJNR00 EQ L_T_DATA-ZZOBJNR00 AND

OBJNR01 EQ L_T_DATA-ZZOBJNR01 AND

OBJNR02 EQ L_T_DATA-ZZOBJNR02 AND

OBJNR03 EQ L_T_DATA-ZZOBJNR03 AND

DRCRK EQ L_T_DATA-ZZDRCRK.

SORT ZBW_FAGLFLEXT BY V_TIMESTAMP.

CLEAR WA_FAGLFLEXT.

LOOP AT L_T_DATA ASSIGNING <L_S_DATA>.

READ TABLE ZBW_FAGLFLEXT INTO WA_FAGLFLEXT WITH KEY V_TIMESTAMP = <L_S_DATA>-RYEAR BINARY SEARCH.

IF SY-SUBRC = 0.



*update the TimeStamp field from IT_FAGLFLEXT table

<L_S_DATA>-ZZTIMESTAMP = WA_FAGLFLEXT-V_TIMESTAMP.

ENDIF.

ENDLOOP.

ENDIF.

C_T_DATA[] = L_T_DATA[].

REFRESH : L_T_DATA,

ZBW_FAGLFLEXT.

ENDMETHOD.

Your help required

Thanks

Imran Shafiq

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 17, 2017 at 01:32 PM

    Could you post your actual code, this one shouldn't allow activation? internal table and read table in it are not complient with the select statement, etc. Also you didn't check datasource name, did you activate class and implementation?

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded