Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

unable to print GL description in output

durgaprasad_sharma2
Participant
0 Kudos
226

hello Gurus,

i have query please can any one help me with the book code of taxinn to taxing.....

TYPE-POOLS : SLIS.
TABLES : BSis.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-011.
SELECT-OPTIONS : S_BUKRS FOR BSIS-BUKRS,
                  S_HKONT FOR BSIS-HKONT.
PARAMETERS : RB1 RADIOBUTTON GROUP RB,
              RB2 RADIOBUTTON GROUP RB.

SELECTION-SCREEN END OF BLOCK B1.
TYPES :BEGIN OF TY_FINAL,
             BUKRS TYPE BUKRS ,         "bsis company code
             HKONT TYPE HKONT ,         "bsis general ledger account
             BELNR TYPE  BELNR_D,       "bsis account document number
             BUDAT TYPE  BUDAT,         "bsis posting date
             BSCHL TYPE  BSCHL ,        "bsis  posting key
             DMBTR TYPE  DMBTR,         "bsis amount in local currency
             WRBTR TYPE  WRBTR,         "bsis amount in document currency
          END OF TY_FINAL.
DATA : LV_FNAME TYPE STRING,
          T_FINAL TYPE TABLE OF TY_FINAL,
          WA_FINAL TYPE TY_FINAL,
          IT_FCAT TYPE SLIS_T_FIELDCAT_ALV ,
          WA_FCAT TYPE SLIS_FIELDCAT_ALV.

START-OF-SELECTION.
   PERFORM GET_DATA.

   IF  WA_FINAL IS INITIAL.
     PERFORM F_FIELDCAT_DATA.
     PERFORM F_DISPLAY_DATA.
     PERFORM F_DOWNLOAD_DATA.
   ENDIF.

FORM GET_DATA .
   SELECT
             BUKRS         "bsis company code
             HKONT         "bsis general ledger account
             BELNR         "bsis account document number
             BUDAT         "bsis posting date
             BSCHL         "bsis  posting key
             DMBTR         "bsis amount in local currency
             WRBTR         "bsis amount in document currency

   FROM BSIS  INTO TABLE T_FINAL WHERE BUKRS IN s_BUKRS AND HKONT IN S_HKONT.


ENDFORM.

FORM F_FIELDCAT_DATA .

   REFRESH : IT_FCAT.
   CLEAR  : WA_FCAT.

   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '1'.
   WA_FCAT-FIELDNAME = 'BUKRS'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-001.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.

   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '2'.
   WA_FCAT-FIELDNAME = 'HKONT'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-002.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.

   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '3'.
   WA_FCAT-FIELDNAME = 'BELNR'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-003.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.


   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '4'.
   WA_FCAT-FIELDNAME = 'BUDAT'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-004.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.

   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '5'.
   WA_FCAT-FIELDNAME = 'BSCHL'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-005.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.

   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '6'.
   WA_FCAT-FIELDNAME = 'DMBTR'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-006.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.

   WA_FCAT-ROW_POS = '1'.
   WA_FCAT-COL_POS = '7'.
   WA_FCAT-FIELDNAME = 'WRBTR'.
   WA_FCAT-TABNAME = 'T_FINAL'.
   WA_FCAT-SELTEXT_M = TEXT-007.
   APPEND WA_FCAT TO IT_FCAT.
   CLEAR WA_FCAT.


ENDFORM.                    " F_FIELDCAT_DATA

FORM F_DISPLAY_DATA .
   IF RB1 = 'X' .
     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM      = SY-REPID
         I_CALLBACK_USER_COMMAND = 'DISPLAY_ITEMS'
         IT_FIELDCAT             = IT_FCAT
         I_SAVE                  = 'A'
       TABLES
         T_OUTTAB                = T_FINAL
       EXCEPTIONS
         PROGRAM_ERROR           = 1
         OTHERS                  = 2.
     IF SY-SUBRC <> 0.
     ENDIF.

   ELSEIF RB2 = 'X' .
     CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM      = SY-REPID
         I_CALLBACK_USER_COMMAND = 'DISPLAY_ITEMS'
         IT_FIELDCAT             = IT_FCAT
         I_SAVE                  = 'A'
       TABLES
         T_OUTTAB                = T_FINAL
       EXCEPTIONS
         PROGRAM_ERROR           = 1
         OTHERS                  = 2.
     IF SY-SUBRC <> 0.
     ENDIF.
   ENDIF.
ENDFORM.                    " F_DISPLAY_DATA

FORM F_DOWNLOAD_DATA .


   CALL FUNCTION 'GUI_DOWNLOAD'
     EXPORTING
       FILENAME              = LV_FNAME
       FILETYPE              = 'ASC'
       WRITE_FIELD_SEPARATOR = ','
     TABLES
       DATA_TAB              = T_FINAL

     EXCEPTIONS
       OTHERS                = 22.
   IF SY-SUBRC <> 0.

   ENDIF.
ENDFORM.



this is my program for generating FI Document but i am not able to print GL Description in the output can anyone help me with the same

...

1 ACCEPTED SOLUTION

ashraf_usmani
Participant
0 Kudos
174

Hello

Please follow below logic:

   SELECT

             BUKRS         "bsis company code

             HKONT         "bsis general ledger account

             BELNR         "bsis account document number

             BUDAT         "bsis posting date

             BSCHL         "bsis  posting key

             DMBTR         "bsis amount in local currency

             WRBTR         "bsis amount in document currency

   FROM BSIS  INTO TABLE T_FINAL WHERE BUKRS IN s_BUKRS AND HKONT IN S_HKONT.


Select TXT20 TXT50 from  SKAT into IT_SKAT

  For All Enteries in T_FINAL

  Where SPRAS = Sy-Langu

   AND SAKNR = T_FINAL-HKONT.


TXT20 (G/L account short text)

TXT50 (G/L Account Long Text)


Hope it will help You


Regards

Ashraf Usmani

5 REPLIES 5

ashraf_usmani
Participant
0 Kudos
175

Hello

Please follow below logic:

   SELECT

             BUKRS         "bsis company code

             HKONT         "bsis general ledger account

             BELNR         "bsis account document number

             BUDAT         "bsis posting date

             BSCHL         "bsis  posting key

             DMBTR         "bsis amount in local currency

             WRBTR         "bsis amount in document currency

   FROM BSIS  INTO TABLE T_FINAL WHERE BUKRS IN s_BUKRS AND HKONT IN S_HKONT.


Select TXT20 TXT50 from  SKAT into IT_SKAT

  For All Enteries in T_FINAL

  Where SPRAS = Sy-Langu

   AND SAKNR = T_FINAL-HKONT.


TXT20 (G/L account short text)

TXT50 (G/L Account Long Text)


Hope it will help You


Regards

Ashraf Usmani

0 Kudos
174

thanks ashraf sir but still i m unable to print the description can you help me with the same coding

0 Kudos
174

thanks ashraf for your precious expertise i m done with the reports thanks a lot have a great day

shadab_maldar
Active Participant
0 Kudos
174

Hi Durgaprasad,

There is no GL Description field in your output(Fieldcatalog), Nither you have fetched it from table SKAT.

Follow the logic provided by will get it.

Regards,

Shadab.

0 Kudos
174

sir i have tried each every possiblities throwing error can u help me wioth the code please