Skip to Content
author's profile photo Former Member
Former Member

edit in a Table control

Hello,

I have created one program for finance.

In this i have created screen by using table control.

in this when i edit data in a single column for a single field of percentage.it shows the total fbt amount but given input value does not change it remains intial value and all data gets changes and shows only one record for number of times.and when i scroll down all data get deleted automatically.

please let me know what could be the reason.

if u need coding i can provide you the same.

its an urgent.

Waiting

Thanks

Suchita

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 06:39 AM

    Hi suchita,

    can you please share the code??it would give the clear picture

    Cheers,

    Deepthee Kasal

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Please find below coding

      and let me know soon.

      Thanks

      take care

      suchita

      &----


      *& Report ZFI_BNP_FBT_TEST1

      *&

      &----


      *&

      *&

      &----


      REPORT ZFI_BNP_FBT_TEST1.

      tables: zfbt,zfbt_ids,bseg,bkpf,zglfbt.

      *CONTROLS: t_ctrl TYPE TABLEVIEW USING SCREEN '400'.

      CONTROLS GLTABSC TYPE TABLEVIEW USING SCREEN 200.

      Data : IT_GLTAB LIKE ZFBT OCCURS 0 WITH HEADER LINE.

      Data : IT_GLTAB2 LIKE ZFBT OCCURS 0 WITH HEADER LINE.

      CONTROLS GLTABSC2 TYPE TABLEVIEW USING SCREEN 300.

      Data : IT_GLTAB3 LIKE ZFBT_IDS OCCURS 0 WITH HEADER LINE.

      Data : IT_GLTAB4 LIKE ZFBT_IDS OCCURS 0 WITH HEADER LINE.

      CONTROLS GLTABSC3 TYPE TABLEVIEW USING SCREEN 400.

      Data : ITGLTAB5 LIKE ZGLFBT OCCURS 0 WITH HEADER LINE.

      DATA : FDATE LIKE ZGLFBT-BUDAT,

      TDATE LIKE ZGLFBT-BUDAT,

      TPLANT LIKE ZGLFBT-BUKRS,

      • GLHEAD LIKE ZGLFBT-HKONT,

      GLHEAD LIKE ZFBT-HKONT,

      ACNAME LIKE SKAT-TXT50,

      date_from like ZFBT_IDS-budat,

      date_to like ZFBT_IDS-budat,

      LINES TYPE I,

      EX TYPE I,

      FILL TYPE i,

      LIMIT TYPE i,

      save_ok type i,

      V_PLANT1 LIKE T001W-NAME1.

      DATA: AMOUNT TYPE I.

      DATA: FBT_AMOUNT TYPE I.

      DATA: FLG, "FLAG TO SET THE CHANGE MODE.

      LN TYPE I. "NO. OF RECORDS.

      *DATA: LS TYPE C.

      *SELECT * FROM ZGLFBT INTO CORRESPONDING FIELDS OF TABLE ITGLTAB5

      • WHERE PERCENTAGE = IT_GLTAB4-PERCENTAGE.

      DATA: BEGIN OF ITBSEG OCCURS 0,

      BELNR LIKE BSEG-BELNR,

      HKONT LIKE BSEG-HKONT,

      WRBTR LIKE BSEG-WRBTR,

      BUDAT LIKE BKPF-BUDAT,

      SGTXT LIKE BSEG-SGTXT,

      END OF ITBSEG.

      Data : IT_BSEG LIKE BSEG OCCURS 0 WITH HEADER LINE.

      DATA: cols LIKE LINE OF GLTABSC-cols.

      call screen 100.

      &----


      *& Module STATUS_0100 OUTPUT

      &----


      • text

      ----


      MODULE STATUS_0100 OUTPUT.

      SET PF-STATUS 'MAINWINDOW'.

      SET TITLEBAR 'MAINWINDOW'.

      ENDMODULE. " STATUS_0100 OUTPUT

      &----


      *& Module USER_COMMAND_0100 INPUT

      &----


      • text

      ----


      MODULE USER_COMMAND_0100 INPUT.

      CASE SY-UCOMM.

      WHEN 'EXIT'.

      LEAVE PROGRAM.

      WHEN 'GLACCOUNT'.

      DATA : PASSWORD TYPE STRING,

      USER TYPE STRING.

      DATA : REGISTRY_TAB TYPE UDDICLS_REGISTRIES.

      CLEAR USER.

      CLEAR PASSWORD.

      CALL FUNCTION 'POPUP_GET_USER_PASSWORD'

      IMPORTING

      USER = USER

      PASSWORD = PASSWORD

      TABLES

      REGISTRY_TAB = REGISTRY_TAB

      EXCEPTIONS

      CANCEL_PRESSED = 1

      OTHERS = 2.

      IF SY-SUBRC <> 0.

      MESSAGE 'Password Entry Cancelled' TYPE 'S'.

      EXIT.

      ELSE.

      IF USER = 'PL1003' AND PASSWORD = 'PL1003'. " For Plant 3

      GLTABSC-LINES = '100'.

      CALL SCREEN 200.

      ELSE.

      MESSAGE 'Verify user name and password' TYPE 'E'.

      ENDIF.

      ENDIF.

      WHEN 'TAXCODE'.

      DATA : PASSWORD1 TYPE STRING,

      USER1 TYPE STRING.

      DATA : REGISTRY_TAB1 TYPE UDDICLS_REGISTRIES.

      CLEAR USER.

      CLEAR PASSWORD.

      CALL FUNCTION 'POPUP_GET_USER_PASSWORD'

      IMPORTING

      USER = USER

      PASSWORD = PASSWORD

      TABLES

      REGISTRY_TAB = REGISTRY_TAB

      EXCEPTIONS

      CANCEL_PRESSED = 1

      OTHERS = 2.

      IF SY-SUBRC <> 0.

      MESSAGE 'Password Entry Cancelled' TYPE 'S'.

      EXIT.

      ELSE.

      IF USER = 'PL1003' AND PASSWORD = 'PL1003'. " For Plant 3

      GLTABSC-LINES = '100'.

      CALL SCREEN 300.

      ELSE.

      MESSAGE 'Verify user name and password' TYPE 'E'.

      ENDIF.

      ENDIF.

      WHEN 'FBTDETAILS'.

      PERFORM CLEARDETDATA.

      GLTABSC3-LINES = '100'.

      CALL SCREEN 400.

      WHEN 'BACK'.

      LEAVE PROGRAM.

      endcase.

      ENDMODULE. " USER_COMMAND_0100 INPUT

      &----


      *& Module STATUS_0200 OUTPUT

      &----


      • text

      ----


      MODULE STATUS_0200 OUTPUT.

      SET PF-STATUS 'GLENTRY'.

      SET TITLEBAR 'GLENTRY'.

      ENDMODULE. " STATUS_0200 OUTPUT

      &----


      *& Module USER_COMMAND_0200 INPUT

      &----


      • text

      ----


      MODULE USER_COMMAND_0200 INPUT.

      CASE SY-UCOMM.

      WHEN 'CREATE'.

      LOOP AT GLTABSC-cols INTO cols .

      IF cols-screen-input = '0'.

      cols-screen-input = '1'.

      ENDIF.

      MODIFY GLTABSC-cols FROM cols INDEX sy-tabix.

      ENDLOOP.

      CLEAR IT_GLTAB.

      CLEAR IT_GLTAB[].

      CLEAR IT_GLTAB2.

      CLEAR IT_GLTAB2[].

      WHEN 'DISPLAY'.

      PERFORM ADDGLDATA.

      WHEN 'EXIT'.

      LEAVE PROGRAM.

      WHEN 'BACK'.

      LEAVE TO SCREEN 100..

      WHEN 'UP'.

      LEAVE TO SCREEN 100..

      WHEN 'SAVE'.

      MODIFY zfbt FROM TABLE IT_GLTAB.

      ENDCASE.

      ENDMODULE. " USER_COMMAND_0200 INPUT

      &----


      *& Module FILL_LINES OUTPUT

      &----


      • text

      ----


      MODULE FILL_LINES OUTPUT.

      GLTABSC-LINES = '100'.

      ENDMODULE. " FILL_LINES OUTPUT

      &----


      *& Module cancel INPUT

      &----


      • text

      ----


      MODULE cancel INPUT.

      LEAVE PROGRAM.

      ENDMODULE. " cancel INPUT

      &----


      *& Module CHECK_HKONT INPUT

      &----


      • text

      ----


      MODULE CHECK_HKONT INPUT.

      IF IT_GLTAB2-HKONT <> ' '.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = IT_GLTAB2-HKONT

      IMPORTING

      OUTPUT = IT_GLTAB2-HKONT.

      SELECT COUNT(*) FROM SKAT

      WHERE SAKNR = IT_GLTAB2-HKONT.

      IF SY-SUBRC <> '0'.

      MESSAGE 'NO RECORDS FOUND FOR THIS GL HEAD' TYPE 'I'.

      ENDIF.

      ENDIF.

      ENDMODULE. " CHECK_HKONT INPUT

      &----


      *& Module FILL_DATA INPUT

      &----


      • text

      ----


      MODULE FILL_DATA INPUT.

      IF IT_GLTAB2-HKONT <> ''.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = IT_GLTAB2-HKONT

      IMPORTING

      OUTPUT = IT_GLTAB2-HKONT.

      SELECT SINGLE TXT50

      INTO IT_GLTAB2-TXT50

      FROM SKAT

      WHERE SAKNR = IT_GLTAB2-HKONT

      and ktopl = 'CAIN'.

      ELSE.

      IT_GLTAB2-TXT50 = ''.

      ENDIF.

      **********changes**********

      READ TABLE IT_GLTAB INDEX GLTABSC-CURRENT_LINE.

      IF SY-SUBRC <> 0.

      IT_GLTAB-HKONT = IT_GLTAB2-HKONT.

      IT_GLTAB-TXT50 = IT_GLTAB2-TXT50.

      IT_GLTAB-KTOPL = IT_GLTAB2-KTOPL.

      • IT_GLTAB-TXT20 = IT_GLTAB2-TXT20.

      APPEND IT_GLTAB.

      • APPEND IT_GLTAB2.

      **********changed***************

      else.

      • IT_GLTAB-HKONT = IT_GLTAB2-HKONT.

      • IT_GLTAB-TXT50 = IT_GLTAB2-TXT50.

      • IT_GLTAB-KTOPL = IT_GLTAB2-KTOPL.

      MODIFY it_gltab INDEX sy-tabix FROM it_gltab2

      TRANSPORTING hkont txt50 ktopl.

      ENDIF.

      ENDMODULE. " FILL_DATA INPUT

      &----


      *& Form ADDGLDATA

      &----


      • text

      ----


      • --> p1 text

      • <-- p2 text

      ----


      FORM ADDGLDATA .

      LOOP AT GLTABSC-cols INTO cols .

      IF cols-screen-input = '1'.

      cols-screen-input = '0'.

      ENDIF.

      MODIFY GLTABSC-cols FROM cols INDEX sy-tabix.

      ENDLOOP.

      CLEAR IT_GLTAB.

      CLEAR IT_GLTAB[].

      CLEAR IT_GLTAB2.

      CLEAR IT_GLTAB2[].

      *clear GSBER.

      SELECT * INTO TABLE

      IT_GLTAB

      FROM ZFBT.

      ENDFORM. " ADDGLDATA

      &----


      *& Module FILL_LINES2 OUTPUT

      &----


      • text

      ----


      MODULE FILL_LINES2 OUTPUT.

      GLTABSC2-LINES = '100'.

      ENDMODULE. " FILL_LINES2 OUTPUT

      &----


      *& Module cancel1 INPUT

      &----


      • text

      ----


      MODULE cancel1 INPUT.

      LEAVE PROGRAM.

      ENDMODULE. " cancel1 INPUT

      &----


      *& Module FILL_DATA3 INPUT

      &----


      • text

      ----


      MODULE FILL_DATA3 INPUT.

      READ TABLE IT_GLTAB3 INDEX GLTABSC2-CURRENT_LINE.

      IF SY-SUBRC <> 0.

      IT_GLTAB3-GSBER = IT_GLTAB4-GSBER.

      IT_GLTAB3-TAXES = IT_GLTAB4-TAXES.

      IT_GLTAB3-TEXT1 = IT_GLTAB4-TEXT1.

      IT_GLTAB3-BUDAT = IT_GLTAB4-BUDAT.

      APPEND IT_GLTAB3.

      ENDIF.

      ENDMODULE. " FILL_DATA3 INPUT

      &----


      *& Module USER_COMMAND_0300 INPUT

      &----


      • text

      ----


      MODULE USER_COMMAND_0300 INPUT.

      CASE SY-UCOMM.

      WHEN 'CREATE'.

      CLEAR IT_GLTAB3.

      CLEAR IT_GLTAB3[].

      CLEAR IT_GLTAB4.

      CLEAR IT_GLTAB4[].

      CLEAR DATE_FROM.

      CLEAR DATE_TO.

      LOOP AT GLTABSC2-cols INTO cols .

      IF cols-screen-input = '0'.

      cols-screen-input = '1'.

      ENDIF.

      MODIFY GLTABSC2-cols FROM cols INDEX sy-tabix.

      ENDLOOP.

      *

      WHEN 'DISPLAY'.

      PERFORM ADDTAXDATA.

      WHEN 'EXIT'.

      LEAVE PROGRAM.

      WHEN 'BACK'.

      LEAVE TO SCREEN 100..

      WHEN 'UP'.

      LEAVE TO SCREEN 100..

      WHEN 'SAVE'.

      MODIFY ZFBT_IDS FROM TABLE IT_GLTAB3.

      ENDCASE.

      ENDMODULE. " USER_COMMAND_0300 INPUT

      &----


      *& Form ADDTAXDATA

      &----


      • text

      ----


      • --> p1 text

      • <-- p2 text

      ----


      FORM ADDTAXDATA .

      *LOOP AT GLTABSC2-cols INTO cols .

      • IF cols-screen-input = '1'.

      • cols-screen-input = '0'.

      • ENDIF.

      *MODIFY GLTABSC2-cols FROM cols INDEX sy-tabix.

      *ENDLOOP.

      *

      CLEAR IT_GLTAB3.

      CLEAR IT_GLTAB3[].

      CLEAR DATE_FROM.

      CLEAR DATE_TO.

      LOOP AT GLTABSC2-cols INTO cols .

      IF cols-screen-input = '1'.

      cols-screen-input = '0'.

      ENDIF.

      MODIFY GLTABSC2-cols FROM cols INDEX sy-tabix.

      ENDLOOP.

      SELECT * INTO TABLE

      IT_GLTAB3

      FROM ZFBT_IDS.

      LOOP AT IT_GLTAB3 WHERE BUDAT >= DATE_FROM AND BUDAT <= DATE_TO .

      ENDLOOP.

      ENDFORM. " ADDTAXDATA

      &----


      *& Module STATUS_0300 OUTPUT

      &----


      • text

      ----


      MODULE STATUS_0300 OUTPUT.

      SET PF-STATUS 'TAXMENU'.

      SET TITLEBAR 'TAXMENU'.

      ENDMODULE. " STATUS_0300 OUTPUT

      &----


      *& Module STATUS_0400 OUTPUT

      &----


      • text

      ----


      MODULE STATUS_0400 OUTPUT.

      SET PF-STATUS 'GDETAILM'.

      SET TITLEBAR 'GDETAILT'.

      SELECT SINGLE NAME1

      INTO V_PLANT1

      FROM T001W

      WHERE WERKS = TPLANT.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = GLHEAD

      IMPORTING

      OUTPUT = GLHEAD.

      SELECT SINGLE TXT50

      INTO ACNAME

      FROM SKAT

      WHERE SAKNR = GLHEAD.

      DESCRIBE TABLE ITGLTAB5 LINES LINES.

      GLTABSC3-LINES = LINES.

      ENDMODULE. " STATUS_0400 OUTPUT

      &----


      *& Module USER_COMMAND_0400 INPUT

      &----


      • text

      ----


      MODULE USER_COMMAND_0400 INPUT.

      CASE SY-UCOMM.

      WHEN 'CREATE'.

      LOOP AT GLTABSC3-cols INTO cols .

      IF cols-screen-input = '0'.

      cols-screen-input = '1'.

      ENDIF.

      MODIFY GLTABSC3-cols FROM cols INDEX sy-tabix.

      ENDLOOP.

      CLEAR ITGLTAB5.

      CLEAR ITGLTAB5[].

      • CLEAR ITGLTAB6.

      • CLEAR ITGLTAB6[].

      CLEAR IT_GLTAB4.

      CLEAR IT_GLTAB4[].

      *

      CLEAR IT_BSEG.

      CLEAR IT_BSEG[].

      CLEAR ITBSEG.

      CLEAR ITBSEG[].

      CLEAR FDATE.

      CLEAR TDATE.

      CLEAR TPLANT.

      CLEAR GLHEAD.

      CLEAR ACNAME.

      CLEAR LINES.

      CLEAR EX.

      CLEAR FILL.

      CLEAR LIMIT.

      CLEAR V_PLANT1.

      clear bkpf-budat.

      GLTABSC3-LINES = '100'.

      *LOOP AT GLTABSC3-cols INTO cols .

      • IF cols-screen-input = '0'.

      • cols-screen-input = '1'.

      • ENDIF.

      *MODIFY GLTABSC3-cols FROM cols INDEX sy-tabix.

      *ENDLOOP.

      WHEN 'CHANGE'.

      *FLG = 'Y'.

      *IF LS = 'X'.

      • MESSAGE I888(TEXT).

      • MODIFY ITGLTAB5 INDEX GLTABSC3-CURRENT_LINE.

      *

      • MODIFY ZGLFBT FROM TABLE ITGLTAB5 .

      *

      • ENDIF.

      IF lines NE 0.

      LOOP AT SCREEN.

      ***To make the screen editable****

      screen-input = 1.

      ENDLOOP.

      ELSE.

      LOOP AT SCREEN.

      IF screen-name CS 'ITGLTAB5'.

      ****To make the screen non-editable if no values are present in the

      ***table control****

      screen-input = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      WHEN 'DISPLAY'.

      PERFORM ADDDATA.

      WHEN 'EXIT'.

      LEAVE PROGRAM.

      WHEN 'BACK'.

      LEAVE TO SCREEN 100..

      WHEN 'UP'.

      LEAVE TO SCREEN 100..

      WHEN 'SAVE'.

      LOOP AT ITGLTAB5.

      ITGLTAB5-BELNR = ITBSEG-BELNR.

      ITGLTAB5-HKONT = ITBSEG-HKONT.

      ITGLTAB5-WRBTR = ITBSEG-WRBTR.

      ITGLTAB5-BUDAT = ITBSEG-BUDAT.

      ITGLTAB5-GSBER = IT_GLTAB4-GSBER.

      ITGLTAB5-TAXES = IT_GLTAB4-TAXES.

      ITGLTAB5-BUDAT = TDATE.

      ITGLTAB5-SGTXT = ITBSEG-SGTXT.

      ITGLTAB5-AMOUNT = AMOUNT.

      ITGLTAB5-FBTAMOUNT = FBT_AMOUNT.

      ITGLTAB5-PERCENTAGE = IT_GLTAB4-PERCENTAGE.

      • INSERT INTO ZGLFBT VALUES ITGLTAB5.

      MODIFY ZGLFBT FROM TABLE ITGLTAB5.

      endloop.

      ENDCASE.

      ENDMODULE. " USER_COMMAND_0400 INPUT

      &----


      *& Module FILL_LINES3 OUTPUT

      &----


      • text

      ----


      MODULE FILL_LINES3 OUTPUT.

      GLTABSC3-LINES = '100'.

      ENDMODULE. " FILL_LINES3 OUTPUT

      &----


      *& Module cancel2 INPUT

      &----


      • text

      ----


      MODULE cancel2 INPUT.

      LEAVE PROGRAM.

      ENDMODULE. " cancel2 INPUT

      &----


      *& Module CLEARTAB5 INPUT

      &----


      • text

      ----


      MODULE CLEARTAB5 INPUT.

      CLEAR ITGLTAB5.

      CLEAR ITGLTAB5[].

      *

      ENDMODULE. " CLEARTAB5 INPUT

      &----


      *& Module CHECK_HKONT3 INPUT

      &----


      • text

      ----


      MODULE CHECK_HKONT3 INPUT.

      IF ITGLTAB5-GSBER <> ' '.

      SELECT COUNT(*) FROM ZFBT_IDS

      WHERE GSBER = IT_GLTAB4-GSBER.

      • IF SY-SUBRC <> '0'.

      • MESSAGE 'INVALID TAX CODE ' TYPE 'I'.

      • ELSE.

      SELECT SINGLE TEXT1 TAXES

      INTO (ITGLTAB5-TEXT1,ITGLTAB5-TAXES)

      FROM ZFBT_IDS

      WHERE GSBER = ITGLTAB5-GSBER.

      • AMOUNT = ( ITGLTAB5-WRBTR * ITGLTAB5-PERCENTAGE ) / 100 .

      *

      • FBT_AMOUNT = ( AMOUNT * ITGLTAB5-TAXES ) / 100.

      IT_GLTAB4-PERCENTAGE = '100'.

      ENDIF.

      • ENDIF.

      ENDMODULE. " CHECK_HKONT3 INPUT

      &----


      *& Module CHECK_HKONT_GLHEAD INPUT

      &----


      • text

      ----


      MODULE CHECK_HKONT_GLHEAD INPUT.

      IF GLHEAD <> ' '.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = GLHEAD

      IMPORTING

      OUTPUT = GLHEAD.

      SELECT COUNT(*) FROM ZFBT

      WHERE HKONT = GLHEAD.

      • IF sy-subrc <> 0.

      • ITGLTAB6-GSBER = GLHEAD.

      IF SY-SUBRC <> '0'.

      MESSAGE 'PL CREATE G/L HEAD ENTRY ' TYPE 'I'.

      ENDIF.

      ENDIF.

      ENDMODULE. " CHECK_HKONT_GLHEAD INPUT

      &----


      *& Module TABLINES INPUT

      &----


      • text

      ----


      MODULE TABLINES INPUT.

      DESCRIBE TABLE ITGLTAB5 LINES LINES.

      GLTABSC3-LINES = LINES.

      ENDMODULE. " TABLINES INPUT

      &----


      *& Module FILL_DATA4 INPUT

      &----


      • text

      ----


      MODULE FILL_DATA4 INPUT.

      IF IT_GLTAB2-HKONT <> ''.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = IT_GLTAB2-HKONT

      IMPORTING

      OUTPUT = IT_GLTAB2-HKONT.

      ENDIF.

      AMOUNT = ( ITGLTAB5-WRBTR * ITGLTAB5-PERCENTAGE ) / 100 .

      FBT_AMOUNT = ( AMOUNT * ITGLTAB5-TAXES ) / 100.

      READ TABLE ITGLTAB5 INDEX GLTABSC3-CURRENT_LINE.

      *DELETE ADJACENT DUPLICATES FROM ITGLTAB5.

      *SORT ITGLTAB5 BY BELNR SGTXT GSBER TAXES PERCENTAGE FBTAMOUNT.

      *DELETE ADJACENT DUPLICATES FROM ITGLTAB5 COMPARING BELNR SGTXT GSBER TAXES PERCENTAGE FBTAMOUNT.

      IF sy-subrc <> 0.

      • ITGLTAB5-BELNR = ITGLTAB6-BELNR.

      • ITGLTAB5-HKONT = ITGLTAB6-HKONT.

      • ITGLTAB5-WRBTR = ITGLTAB6-WRBTR.

      • ITGLTAB5-GSBER = ITGLTAB6-GSBER.

      • ITGLTAB5-TAXES = ITGLTAB6-TAXES.

      • ITGLTAB5-AMOUNT = ITGLTAB6-AMOUNT.

      • ITGLTAB5-BUKRS = TPLANT.

      ITGLTAB5-BELNR = IT_BSEG-BELNR.

      ITGLTAB5-HKONT = IT_BSEG-HKONT.

      ITGLTAB5-WRBTR = IT_BSEG-WRBTR.

      ITGLTAB5-GSBER = IT_BSEG-GSBER.

      ITGLTAB5-TAXES = IT_GLTAB4-TAXES.

      ITGLTAB5-AMOUNT = AMOUNT.

      ITGLTAB5-BUKRS = TPLANT.

      ITGLTAB5-SGTXT = IT_BSEG-SGTXT.

      ITGLTAB5-PERCENTAGE = IT_GLTAB4-PERCENTAGE.

      ITGLTAB5-FBTAMOUNT = FBT_AMOUNT.

      SELECT SINGLE TAXES

      INTO ITGLTAB5-TAXES

      FROM ZFBT_IDS

      WHERE GSBER = IT_GLTAB4-GSBER.

      • AND TEXT1 = ITGLTAB5-TEXT1.

      • AND PERCENTAGE = '100'.

      *SELECT SINGLE GSBER TAXES

      • INTO (ITGLTAB5-TAXES,ITGLTAB5-GSBER)

      • FROM ZFBT_IDS.

      • WHERE HKONT = GLHEAD.

      *

      *

      *SELECT SINGLE TAXES

      • INTO ITGLTAB5-TAXES

      • FROM ZFBT_IDS

      • WHERE GSBER = IT_GLTAB4-GSBER.

      APPEND ITGLTAB5.

      ELSE.

      • ITGLTAB5-BELNR = ITGLTAB6-BELNR.

      • ITGLTAB5-HKONT = ITGLTAB6-HKONT.

      • ITGLTAB5-WRBTR = ITGLTAB6-WRBTR.

      • ITGLTAB5-GSBER = ITGLTAB6-GSBER.

      • ITGLTAB5-TAXES = ITGLTAB6-TAXES.

      • ITGLTAB5-AMOUNT = ITGLTAB6-AMOUNT.

      • ITGLTAB5-BUKRS = TPLANT.

      SELECT SINGLE TAXES

      INTO ITGLTAB5-TAXES

      FROM ZFBT_IDS

      WHERE GSBER = IT_GLTAB4-GSBER.

      • SELECT SINGLE GSBER TAXES

      • INTO (ITGLTAB5-TAXES,ITGLTAB5-GSBER)

      • FROM ZFBT_IDS.

      • WHERE HKONT = GLHEAD.

      • MODIFY ITGLTAB5 INDEX GLTABSC3-CURRENT_LINE.

      • MODIFY ITGLTAB5 INDEX sy-tabix FROM ITGLTAB5

      • TRANSPORTING BELNR HKONT WRBTR GSBER TAXES AMOUNT.

      • ENDIF.

      *lines = sy-loopc.

      DESCRIBE TABLE ITGLTAB5 LINES LINES.

      GLTABSC3-LINES = LINES.

      CLEAR ITGLTAB5.

      • CLEAR ITGLTAB6.

      ENDIF.

      ENDMODULE. " FILL_DATA4 INPUT

      &----


      *& Form CLEARDETDATA

      &----


      • text

      ----


      • --> p1 text

      • <-- p2 text

      ----


      FORM CLEARDETDATA .

      CLEAR ITGLTAB5.

      • CLEAR ITGLTAB6.

      CLEAR ITGLTAB5[].

      • CLEAR ITGLTAB6[].

      CLEAR IT_GLTAB4.

      CLEAR IT_GLTAB4[].

      CLEAR IT_BSEG.

      CLEAR IT_BSEG[].

      CLEAR ITBSEG.

      CLEAR ITBSEG[].

      CLEAR FDATE.

      CLEAR TDATE.

      CLEAR TPLANT.

      CLEAR GLHEAD.

      CLEAR ACNAME.

      CLEAR LINES.

      CLEAR EX.

      CLEAR FILL.

      CLEAR LIMIT.

      CLEAR V_PLANT1.

      clear bkpf-budat.

      ENDFORM. " CLEARDETDATA

      &----


      *& Form ADDDATA

      &----


      • text

      ----


      • --> p1 text

      • <-- p2 text

      ----


      FORM ADDDATA .

      *LOOP AT GLTABSC3-cols INTO cols .

      • IF cols-screen-input = '1'.

      • cols-screen-input = '0'.

      • ENDIF.

      *MODIFY GLTABSC3-cols FROM cols INDEX sy-tabix.

      *ENDLOOP.

      *

      CLEAR ITGLTAB5.

      • CLEAR ITGLTAB6.

      CLEAR ITGLTAB5[].

      • CLEAR ITGLTAB6[].

      CLEAR IT_GLTAB4.

      CLEAR IT_GLTAB4[].

      CLEAR IT_BSEG.

      CLEAR IT_BSEG[].

      CLEAR ITBSEG.

      CLEAR ITBSEG[].

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = GLHEAD

      IMPORTING

      OUTPUT = GLHEAD.

      SELECT * FROM

      BSEG INTO TABLE IT_BSEG

      WHERE HKONT = GLHEAD AND

      BUKRS = TPLANT

      .

      LOOP AT IT_BSEG.

      ITBSEG-BELNR = IT_BSEG-BELNR.

      ITBSEG-HKONT = IT_BSEG-HKONT.

      ITBSEG-WRBTR = IT_BSEG-WRBTR.

      ITBSEG-SGTXT = IT_BSEG-SGTXT.

      SORT ITGLTAB5 BY BELNR SGTXT GSBER TAXES PERCENTAGE FBTAMOUNT.

      DELETE ADJACENT DUPLICATES FROM ITGLTAB5 COMPARING BELNR SGTXT GSBER TAXES PERCENTAGE FBTAMOUNT.

      SELECT SINGLE BUDAT

      INTO ITBSEG-BUDAT

      FROM BKPF

      WHERE BELNR = IT_BSEG-BELNR AND

      BUKRS = TPLANT AND

      BUDAT = TDATE.

      • BUDAT >= FDATE AND

      • BUDAT <= TDATE.

      *SELECT SINGLE BELNR

      • INTO ITBSEG-BELNR

      • FROM BKPF

      • WHERE BUKRS = TPLANT AND

      • BUDAT = TDATE.

      APPEND ITBSEG.

      ENDLOOP.

      SELECT * FROM

      ZFBT_IDS INTO TABLE IT_GLTAB4.

      • WHERE PERCENTAGE = '100'.

      .

      • WHERE GSBER = IT_GLTAB-KTOPL.

      LOOP AT IT_GLTAB4.

      SELECT * FROM

      ZFBT INTO TABLE IT_GLTAB2

      WHERE HKONT = GLHEAD.

      LOOP AT IT_GLTAB2.

      • LOOP AT ITBSEG WHERE BUDAT >= FDATE AND BUDAT <= TDATE.

      LOOP AT ITBSEG WHERE BUDAT = TDATE.

      *IF sy-subrc <> 0.

      ITGLTAB5-BELNR = ITBSEG-BELNR.

      • ITGLTAB5-HKONT = ITBSEG-HKONT.

      ITGLTAB5-WRBTR = ITBSEG-WRBTR.

      • ITGLTAB5-BUDAT = ITBSEG-BUDAT.

      • ITGLTAB5-GSBER = IT_GLTAB4-GSBER.

      • ITGLTAB5-TAXES = IT_GLTAB4-TAXES.

      ITGLTAB5-BUDAT = TDATE.

      ITGLTAB5-SGTXT = ITBSEG-SGTXT.

      ITGLTAB5-AMOUNT = AMOUNT.

      • ITGLTAB5-FBTAMOUNT = FBT_AMOUNT.

      ITGLTAB5-PERCENTAGE = '100'.

      select single gsber taxes from zfbt_ids

      into (itgltab5-gsber,itgltab5-taxes)

      where gsber in ( select ktopl from zfbt where hkont = glhead ).

      itgltab5-fbtamount = ( ( itbseg-wrbtr * itgltab5-percentage ) / 100 ) * itgltab5-taxes / 100.

      APPEND ITGLTAB5.

      *SELECT * INTO TABLE

      *ITGLTAB5

      *FROM ZGLFBT WHERE HKONT = ITGLTAB5-HKONT.

      *SELECT * FROM ZGLFBT

      *INTO CORRESPONDING FIELDS OF ITGLTAB5

      *WHERE HKONT = ITGLTAB5-HKONT.

      *

      *ENDSELECT.

      *SELECT * FROM

      • ZFBT_IDS INTO TABLE IT_GLTAB4

      • WHERE GSBER = ITGLTAB5-GSBER.

      *

      *

      • LOOP AT IT_GLTAB4.

      • ITGLTAB5-GSBER = IT_GLTAB4-GSBER.

      • ITGLTAB5-TAXES = IT_GLTAB4-TAXES.

      *APPEND ITGLTAB5.

      *

      *ENDIF.

      ENDLOOP.

      ENDLOOP.

      ENDLOOP.

      *ENDSELECT.

      ENDFORM. " ADDDATA

      &----


      *& Module init_screen OUTPUT

      &----


      • text

      ----


      *MODULE init_screen OUTPUT.

      *

      *LOOP AT SCREEN.

      *IF ( screen-name = 'IT_GLTAB4-GSBER' and screen-name = 'IT_GLTAB4-taxes') AND save_ok = 'CHG'.

      *screen-input = 1.

      *MODIFY SCREEN.

      *ENDIF.

      *

      *ENDLOOP.

      *

      *ENDMODULE. " init_screen OUTPUT

      *&----


      *& Module set_screen_fields OUTPUT

      &----


      • text

      ----


      *MODULE set_screen_fields OUTPUT.

      *

      *LOOP AT SCREEN.

      *IF flg IS INITIAL.

      *screen-input = 0.

      *ELSEIF ( flg EQ 'Y' ).

      *IF ( ( screen-name = 'itgltab5-percentage'

      *OR screen-name = 'itgltab5-fbtamount' )

      *AND GLTABSC3-current_line LE ln ) .

      *

      • Making the screen fields as editable

      *screen-input = 1.

      **ELSEIF ( ( screen-name = 'itgltab5-percentage' )

      **AND GLTABSC3-current_line LE ln ).

      • Making the screen field as uneditable

      **screen-input = 0.

      *ENDIF.

      *ENDIF.

      • Modifying the screen after making changes

      *MODIFY SCREEN.

      *ENDLOOP.

      *

      *ENDMODULE. " set_screen_fields OUTPUT

  • Posted on Jan 16, 2008 at 11:28 AM

    hi suchita.. could u pls..post the flow logic of screen 400 and the codes for its respective modules only, please..i think we could then help u out faster..

    Thanks,

    Nivin

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Nivin Varkey

      Hi nivin,

      Thanks for your kind support.

      problem has been resolved. actually problem was with internal table.the formula which has been taken was wrong .it should be at both place to add data and fill data.

      Thanks a lot

      Take care

      suchita

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 12:54 PM

    Hello Suchita,

    The problem with your table control is that it is appending the same row as many times as yopu make changes in the record and hence it is appearing multiple times in the table control. Secondly the changes you make in the table control on the screen are not getting reflected in the internal table that is being used for filling in the table control.

    Just have a look at your modify module. It is an PAI module written by your table control wizard. Try modify statement in the afore mentioned module and if no then append the new line.

    Hope this is what the problem is!!! and hope this solves your problem.

    Happy Programming

    Zankruti.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.