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

Table Control Text fields problem , help plz

Hello Anand , Rich , John & All

I hav problem with Text 3 fields( type c)(either L or R aligned ) , it is not geting updated , otherwise everything else is perfectly fine(scrolling,sorting etc ....) .

Fields giving problem are

1. Status(20) type c

2. Fdat type date

3. Remark(100) type c

All numerical fields are working fine .

My yahoo messenger-id is sap_moni@yahoo.com

<b>Any light on this will be awarded plz .</b>

FLOW LOGIC 

PROCESS BEFORE OUTPUT.
 MODULE SET_STATUS.
 LOOP AT      ITAB
      WITH    CONTROL TCL1
      CURSOR  TCL1-CURRENT_LINE .

   MODULE SET_LINE_COUNT .

 ENDLOOP.

PROCESS AFTER INPUT.
 MODULE UPD_OK_COD.
 MODULE EXIT_COMAND AT EXIT-COMMAND.
 MODULE SCROLL_SORT.

 LOOP AT ITAB.
      MODULE UPDATE_ITAB.
 ENDLOOP.


 MODULE UPDATE_TABLE.


  



REPORT ZSD_REP_ORDER_BANK_CHANGE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_ORDBANK,MARA,KONV.

CONTROLS: TCL1 TYPE TABLEVIEW USING SCREEN 0200.

DATA: ITAB LIKE ZSD_TABL_ORDBANK OCCURS 0 WITH HEADER LINE,
      WA_ITAB LIKE ZSD_TABL_ORDBANK,
      OK_CODE LIKE SY-UCOMM,
      SAVE_OK_CODE LIKE SY-UCOMM,
      UPD_OK_CODE LIKE SY-UCOMM,
      ANSWER TYPE C,
      I LIKE SY-LOOPC ,
      J LIKE SY-LOOPC,
      V_LINES LIKE SY-LOOPC,
      LINE_COUNT LIKE SY-LOOPC,
      STS  TYPE N,
      EMGRP LIKE MARA-EXTWG,
      QTY LIKE ZSD_TABL_ORDBANK-QTY,
      UPRICE LIKE ZSD_TABL_ORDBANK-UPRICE,
      TOT LIKE ZSD_TABL_ORDBANK-TOT,
      INO LIKE VBAP-POSNR,
      COL TYPE CXTAB_COLUMN,
      COPIED_ONCE ,
      FLDNAME(100),HELP(100).



FIELD-SYMBOLS:
     <FS_ITAB> LIKE LINE OF ITAB,
     <FS_TCL1> LIKE LINE OF TCL1-COLS.



SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.

  SELECT-OPTIONS: S_CCODE FOR ZSD_TABL_ORDBANK-CCODE
                          NO INTERVALS NO-EXTENSION  OBLIGATORY,
                  S_SORG  FOR ZSD_TABL_ORDBANK-SORG
                          NO INTERVALS NO-EXTENSION  OBLIGATORY,
                  S_DCHAN FOR ZSD_TABL_ORDBANK-DISTCHAN,
                  S_DIV FOR ZSD_TABL_ORDBANK-DIV,
                  S_MATNO FOR ZSD_TABL_ORDBANK-MATNO,
                  S_CUSTNO FOR ZSD_TABL_ORDBANK-CUSTNO ,
                  S_QTNO FOR ZSD_TABL_ORDBANK-QTNO,
                  S_QTDAT FOR ZSD_TABL_ORDBANK-QTDAT,
                  S_QTVDAT FOR ZSD_TABL_ORDBANK-QTVALDAT,
                  S_SONO   FOR ZSD_TABL_ORDBANK-SONO.

SELECTION-SCREEN END OF BLOCK b1.


AT SELECTION-SCREEN.
   SELECT * FROM  ZSD_TABL_ORDBANK
               INTO  TABLE ITAB
               WHERE CCODE IN S_CCODE
                 AND SORG IN  S_SORG
                 AND DISTCHAN IN  S_DCHAN
                 AND DIV IN S_DIV
                 AND MATNO IN  S_MATNO
                 AND CUSTNO IN  S_CUSTNO
                 AND QTNO IN  S_QTNO
                 AND QTDAT IN  S_QTDAT
                 AND QTVALDAT IN  S_QTVDAT
                 AND SONO IN  S_SONO .

      IF SY-SUBRC EQ 0.
         REFRESH ITAB.
         CLEAR COPIED_ONCE.
         CALL SCREEN 0200.
      ELSE.
         MESSAGE E012(ZQOTBANK) .
      ENDIF.

*&---------------------------------------------------------------------*
*&      Module  SET_STATUS  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE SET_STATUS OUTPUT.
  SET PF-STATUS '0200'.
  SET TITLEBAR '0200'.
    IF COPIED_ONCE IS INITIAL.
      SELECT * FROM  ZSD_TABL_ORDBANK
               INTO  TABLE ITAB
               WHERE CCODE IN S_CCODE
                 AND SORG IN  S_SORG
                 AND DISTCHAN IN  S_DCHAN
                 AND DIV IN S_DIV
                 AND MATNO IN  S_MATNO
                 AND CUSTNO IN  S_CUSTNO
                 AND QTNO IN  S_QTNO
                 AND QTDAT IN  S_QTDAT
                 AND QTVALDAT IN  S_QTVDAT
                 AND SONO IN  S_SONO .
      IF SY-SUBRC EQ 0.
        DESCRIBE TABLE ITAB LINES V_LINES.
        TCL1-LINES = V_LINES.
      ENDIF.

      COPIED_ONCE = 'X'.
      REFRESH CONTROL 'TCL1' FROM SCREEN '0200'.
   ENDIF.

      LOOP AT ITAB.
         QTY = ITAB-QTY.
         UPRICE  = ITAB-UPRICE.
         TOT = QTY * UPRICE .
         ITAB-TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         QTY = ITAB-CGL_QTY.
         UPRICE  = ITAB-CGL_UPRICE.
         TOT = QTY * UPRICE .
         ITAB-CGL_TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         QTY = ITAB-BHEL_QTY.
         UPRICE  = ITAB-BHEL_UPRICE.
         TOT = QTY * UPRICE .
         ITAB-BHEL_TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         QTY = ITAB-ALSTOM_QTY.
         UPRICE  = ITAB-ALSTOM_UPRICE.
         TOT = QTY * UPRICE .
         ITAB-ALSTOM_TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         QTY = ITAB-SIEMENS_QTY.
         UPRICE  = ITAB-SIEMENS_UPRICE.
         TOT = QTY * UPRICE .
         ITAB-SIEMENS_TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         QTY = ITAB-TELK_QTY.
         UPRICE  = ITAB-TELK_UPRICE.
         TOT = QTY * UPRICE .
         ITAB-TELK_TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         QTY = ITAB-OTH_QTY.
         UPRICE  = ITAB-OTH_UPRICE.
         TOT = QTY * UPRICE .
         ITAB-OTH_TOT = TOT .
         CLEAR: QTY, UPRICE, TOT.

         MODIFY ITAB.

      ENDLOOP.
ENDMODULE.                 " SET_STATUS  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  SET_LINE_COUNT  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE SET_LINE_COUNT OUTPUT.
  LINE_COUNT = SY-LOOPC.

ENDMODULE.                 " SET_LINE_COUNT  INPUT

*&---------------------------------------------------------------------*
*&      Module  UPD_OK_CODE  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE UPD_OK_COD INPUT.
 IF OK_CODE = 'SAVE'.
    UPD_OK_CODE = OK_CODE.
*    CLEAR OK_CODE.
 ENDIF.
ENDMODULE.                 " UPD_OK_CODE  INPUT

*&---------------------------------------------------------------------*
*&      Module  EXIT_COMAND  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE EXIT_COMAND INPUT.
 SAVE_OK_CODE = OK_CODE.
 CLEAR OK_CODE.
 CASE SAVE_OK_CODE.
    WHEN 'BACK'.
      CALL FUNCTION 'POPUP_TO_CONFIRM'
        EXPORTING
          TITLEBAR       = 'Order Bank Entry'
          TEXT_QUESTION  = 'Do you want to Go BacK ?'
          TEXT_BUTTON_1  = 'Yes'
          TEXT_BUTTON_2  = 'No'
          DEFAULT_BUTTON = '2'
        IMPORTING
          ANSWER         = ANSWER.

      IF ANSWER = '1'.
        LEAVE TO SCREEN 0.
      ELSE.

      ENDIF.
    WHEN '%EX'.
      CALL FUNCTION 'POPUP_TO_CONFIRM'
        EXPORTING
          TITLEBAR       = 'Order Bank Entry'
          TEXT_QUESTION  = 'Do you want to Exit ?'
          TEXT_BUTTON_1  = 'Yes'
          TEXT_BUTTON_2  = 'No'
          DEFAULT_BUTTON = '2'
        IMPORTING
          ANSWER         = ANSWER.

      IF ANSWER = '1'.
        LEAVE TO SCREEN 0.
      ELSE.

      ENDIF.
  ENDCASE.

ENDMODULE.                 " EXIT_COMAND  INPUT
*&---------------------------------------------------------------------*
*&      Module  UPDATE_MOD  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE UPDATE_ITAB INPUT.
    MODIFY TABLE ITAB FROM ITAB.
ENDMODULE.                 " UPDATE_MOD  INPUT
*&---------------------------------------------------------------------*
*&      Module SCROLL INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE SCROLL_SORT INPUT.
 SAVE_OK_CODE = OK_CODE.
 CLEAR OK_CODE.
 CASE SAVE_OK_CODE.

  WHEN 'P--'.
      TCL1-TOP_LINE = 1.

  WHEN 'P-'.
      TCL1-TOP_LINE = TCL1-TOP_LINE - LINE_COUNT.
      IF TCL1-TOP_LINE LE 0.
         TCL1-TOP_LINE = 1.
      ENDIF.
  WHEN 'P+'.
      I = TCL1-TOP_LINE + LINE_COUNT.
      J = TCL1-LINES - LINE_COUNT + 1.
      IF J LE 0.
         J = 1.
      ENDIF.
      IF I LE J.
         TCL1-TOP_LINE = I.
      ELSE.
         TCL1-TOP_LINE = J.
      ENDIF.

  WHEN 'P++'.
      TCL1-TOP_LINE = TCL1-LINES - LINE_COUNT + 1.
      IF TCL1-TOP_LINE LE 0.
          TCL1-TOP_LINE = 1.
      ENDIF.
  WHEN 'SORTUP'.
      READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
      IF SY-SUBRC = 0.
          SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
          SORT ITAB ASCENDING BY (FLDNAME).
      ENDIF.

  WHEN 'SORTDN'.
      READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
      IF SY-SUBRC = 0.
          SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
          SORT ITAB DESCENDING BY (FLDNAME).
      ENDIF.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND  INPUT

*&---------------------------------------------------------------------*
*&      Module  TABL_UPD  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
  MODULE UPDATE_TABLE INPUT.

   CASE UPD_OK_CODE.
   WHEN 'SAVE'.
     UPDATE ZSD_TABL_ORDBANK FROM TABLE ITAB .
     IF SY-SUBRC EQ 0.
         MESSAGE I002(ZQOTBANK) .
         CLEAR  UPD_OK_CODE.
     ELSE.
         MESSAGE E003(ZQOTBANK) .
     ENDIF.
   ENDCASE.
  ENDMODULE.                 " TABL_UPD  INPUT

Thnx

moni<b></b><b></b>

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 05, 2005 at 04:58 AM

    Can someOne help plz ?

    This statement upadtes all neumeric values but not the text fields

    MODIFY TABLE ITAB FROM ITAB.

    Any alternative ?

    Message was edited by: md monirujjaman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Moni,

      The problem as I had replied in your earlier post is with the MODIFY statement.

      MODIFY TABLE ITAB FROM ITAB. This statement will do the modifications based on the table key. When you have character fields as editable, then some problems are to be anticipated. In such a scenario, you must update the internal table based on the <i>index</i>, rather than based on <i>key</i>.

      So consider using

      MODIFY ITAB FROM ITAB INDEX TCL-CURRENT_LINE.

      Where TCL is the name of the Table Control. Also observe the difference in syntax here, don't use the TABLE keyword for the MODIFY statement.

      Please try it out and let me know.

      Regards,

      Anand Mandalika.

  • Posted on Feb 04, 2005 at 02:22 PM

    In your flow logic, you need to tell the screen which fields to bring back to ABAP program. Like this.

     LOOP AT ITAB. 
      field: itab-status, itab-fdat, itab-remark.   
      MODULE UPDATE_ITAB. 
    ENDLOOP.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      DEAR RICH

      DID U MEAN FIELDS VALIDATION ?

      ACTUALLY I SELECT SOME RECORDS BASED ON SOME SELECTION CRITERIA , AND DOING SOME CHANGES ON EDITED FIELDS ( DATE ,TEXT )MY TABLE CONTROL .BUT THESE TEXT AND DATE FIELDS ARE NOT GETTING UPDATED EVEN IF I GIVE CORRECT FORMAT.

      HELP IS SOLICITED.

      THNX

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.