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

Table control small Issues , Plz help in tracing the problem

Hello John , Rich , Anand & all

My sorting is working fine but thr is small problem

1. user has habit of pressing enter after everything,

after entering the values in editable fields in Table control , it doesnt retain the entered values but if he presses save button immediately after entering values , it saves .

how 2 hold the values after pressing enter button

2. Now with this code , it saves the table control content but doesnt display the latest values immediately on the screen .

3. User doesnt want to press SAVE button , he wants save the Table control content by pressing ENTER button,

What is the OK_CODE value for Enter Button plz ?

Plllllzzzzz help me for god sake ASAP.

<u><b>Everyone whoever make an attempt is going to get 10 pnts.</b></u>

==========================

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 GET_OK_CODE .

MODULE EXIT_COMAND AT EXIT-COMMAND.

MODULE SCROLL_SORT.

LOOP AT ITAB.

MODULE UPDATE_MOD.

ENDLOOP.

==========================

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 GET_OK_CODE INPUT

&----


  • text

----


MODULE GET_OK_CODE INPUT.

IF OK_CODE = 'SAVE'.

UPD_OK_CODE = OK_CODE.

ENDIF.

ENDMODULE. " GET_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 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 UPDATE_MOD INPUT

&----


  • text

----


MODULE UPDATE_MOD INPUT.

CASE UPD_OK_CODE.

WHEN 'SAVE'.

UPDATE ZSD_TABL_ORDBANK FROM ITAB .

STS = SY-SUBRC .

IF STS NE 0.

MESSAGE E003(ZQOTBANK) .

ENDIF.

ENDCASE.

ENDMODULE. " UPDATE_MOD INPUT

Thnx

Moni

Message was edited by: md monirujjaman

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

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

    Hello Moni,

    I understand how seriously you are stuck with this issue. It is not possible to reward 10 points for everyone who attempts the question :-).

    Please provide the flow logic statements so that I can start working on this.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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 GET_OK_CODE .

      MODULE EXIT_COMAND AT EXIT-COMMAND.

      MODULE SCROLL_SORT.

      LOOP AT ITAB.

      MODULE UPDATE_ITAB.

      ENDLOOP.

      MODULE UPDATE_TABLE.

      changed modules are ......

      &----


      *& Module UPDATE_MOD INPUT

      &----


      • text

      ----


      MODULE UPDATE_ITAB INPUT.

      MODIFY TABLE ITAB FROM ITAB.

      ENDMODULE. " UPDATE_MOD 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 NE 0.

      MESSAGE E003(ZQOTBANK) .

      ENDIF.

      ENDCASE.

      ENDMODULE. " TABL_UPD INPUT

      now i m able 2 get the latest edited values from user immediately i press enter button and getting saved by pressing SAVE button but further problems are, i have one dropdown button for status 1 field , and 1 date field are not getting updated .

      So further help plz.

  • author's profile photo Former Member
    Former Member
    Posted on Feb 04, 2005 at 09:16 AM

    Try this code:

    In PAI, write

    LOOP AT ITAB.
    MODULE UPDATE_ITAB.
    ENDLOOP.
    
    Module update_itab.
    MODIFY ITAB.
    ENDMODULE.

    Here name of the table used in screen and name of the internal table , I assume, are the same.

    Regards,

    Subramanian V.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 04, 2005 at 11:21 AM

    Hi md

    Have a llok on the below stmts...

    wa_scr are screen fields... (wa-field1,wa-field2...etc)

    module user_ok input.

    move-corresponding wa_scr to wa_outtab.

    read table it_outtab into wa_outtab1 with key some_field = wa_outtab-some_field.

    modify it_outtab from wa_outtab index tabl_ctrl-current_line.

    wa_outtab-flag = ''.

    endmodule. " user_ok INPUT

    In Flow - Logic

    PBO.....

    process after input.

    loop .

    module user_ok. (above module.... within loop)

    endloop.

    module user_command_0100.

    -


    Hope this will work out...

    Regards

    Immanuel

    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.