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

LSMW - table control line selection

Hi ,

I am doing a recording to update the long text of operations using IA06 transaction, but when I need to select a particular operation number , in the recording it is showing the line number as (01) or (02) but I need to select a particular operation using its number (0010) or (0020). There is no position button in the transaction also. Please let me know how this kind of line selection can be done.

Regards,

Prabaharan.G

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

12 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 08:07 PM

    Hi Rob,

    Do you mean to say that before entering the transaction I need to retrieve all operation numbers corresponding to that planner group and keep it in an internal table , so that I could position the operation number line based on the internal table values. This sounds to be fine, but coding this in a BDC would be easy but within an LSMW would be bit difficult I suppose.

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2007 at 03:28 PM

    Hi,

    Using a BDC to update long text - Will it cause any problem in regards to data consistency.

    Using Save_text function module will it cause any problem or it is consistent.

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I'm not sure that you are <u>able</u> to update long texts using BDC. Using SAVE_TEXT will not lead to data inconsistencies so long as it is done correctly. So if your testing is adequate, you will be OK.

      Rob

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 06:23 PM

    Try putting your cursor on any field in the line you want and then pressing F2.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 06:37 PM

    Hi Bob,

    My requirement is to select a particular operation number the number of which i read from an input file. If I have operation number 20 in the file then the cursor should focus on the operation 0020 and after selecting it , should open the long text editor and fill values in it.

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 06:54 PM

    Hi Rob,

    My query is if there are 20 operation lines starting from 0010 to 0200 and I need to update long text for operation number 40 then how will I make my cursor position on exactly fourty .

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 07:41 PM

    Hi Rob,

    The F2 option is working but only after selecting a particular line, but my question is how to select the particular operation number. If there are 20 operations and I want to select line of operation 50 it while the recording is running in background. I need to tell the system to select the line corresponding to operation number 50.

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 07:58 PM

    Hi Rob,

    I thought of that option but assume if there are 10 operations 0010 to 0100.

    and my requirement is to select operation line 30 , then using logic i will select the third line item, but if an user deletes operation 0010 and in that case 0020 will be in line 1 and then the logic would operation 40 instead of 30. Can you please let me know if an alternative is present for this.

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 08:34 PM

    Hi Rob and Srini,

    Thanks for your inputs. But I am not much clear about the parameters to be passed to SAVE_TEXT function module. Any reference thread in SDN. Could you please send me the URL .

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2007 at 09:18 PM

    Hi,

    I checked it but none of them is matching the long text update for operation in PM general task list. I checked the text id , it has the value 060A001000010000000100000001 what combination of values is this.

    Regards,

    Prabaharan.G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2007 at 06:07 PM

    Hi ,

    I am using the below code to update the long text existing for operations in general task list IA06, but though the save text returns sy-subrc = 0 the text is not getting updated. Can anyone advise on the problem in the code.

    &----


    *& Report ZPM_LONGTEXT_UPDATE

    *&

    REPORT ZPM_LONGTEXT_UPDATE.

    TYPES: BEGIN OF T_GEN,

    TPLNR LIKE RC27E-TPLNR,

    PLNNR TYPE TAPL-PLNNR,

    PLNAL TYPE TAPL-PLNAL,

    VORNR TYPE PLPO-VORNR,

    LONGTEXT(6000) TYPE C,

    END OF T_GEN.

    TYPES: BEGIN OF T_GENFIN,

    mandt like sy-mandt,

    PLNTY LIKE PLPO-PLNTY,

    PLNNR LIKE PLPO-PLNNR,

    PLNKN LIKE PLPO-PLNKN,

    ZAEHL LIKE TAPL-ZAEHL,

    LONGTEXT(6000) TYPE C,

    END OF T_GENFIN.

    DATA: IT_GEN TYPE TABLE OF T_GEN,

    WA_GEN TYPE T_GEN.

    DATA: IT_GENFIN TYPE TABLE OF T_GENFIN,

    WA_GENFIN TYPE T_GENFIN.

    DATA : LV_NAME LIKE STXH-TDNAME,

    LV_OBJECT LIKE TCA09-OBJOPR,

    LV_ID LIKE OPR_CLASS_DATA-IDENT,

    LV_ERR_TEXT TYPE BAD_PATCH-DESCRIPT,

    LV_SUC_TEXT TYPE BAD_PATCH-DESCRIPT,

    LV_ECN_S LIKE TSK_CLASS_DATA-AENNR VALUE ' ',

    LV_KEYDATE LIKE SY-DATUM,

    LC_OPERATION(3) TYPE C VALUE 'OPR',

    TCA01 TYPE TCA01,

    TCA09 TYPE TCA09,

    LV_LONGTEXT(300) TYPE C.

    DATA : LV_PLPO TYPE STANDARD TABLE OF PLPO WITH HEADER LINE.

    DATA : BEGIN OF LV_TAPL OCCURS 0,

    TPLNR LIKE TAPL-TPLNR,

    PLNTY LIKE TAPL-PLNTY,

    PLNNR LIKE TAPL-PLNNR,

    PLNAL LIKE TAPL-PLNAL,

    ZKRIZ LIKE TAPL-ZKRIZ,

    ZAEHL LIKE TAPL-ZAEHL,

    END OF LV_TAPL.

    DATA : BEGIN OF LV_HEADER.

    INCLUDE STRUCTURE THEAD.

    DATA : END OF LV_HEADER.

    DATA : LT_LONG_TEXT TYPE TABLE OF TLINE WITH HEADER LINE,

    LT_LONG_INIT TYPE TABLE OF TLINE WITH HEADER LINE,

    LV_TEXT_LENGTH TYPE I,

    LV_LOOP_TIMES TYPE I,

    LV_CHAR_POS_LAST TYPE I,

    LV_CHAR_POS_CURR TYPE I,

    LV_NO_LINES TYPE I.

    DATA : LV_PLNNR TYPE TAPL-PLNNR,

    LV_PLNAL TYPE TAPL-PLNAL,

    LV_VORNR TYPE PLPO-VORNR,

    W_PATHUP1 TYPE STRING.

    DATA: W_PATH1 TYPE IBIPPARMS-PATH.

    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

    PARAMETERS: P_INP TYPE IBIPPARMS-PATH.

    SELECTION-SCREEN: END OF BLOCK B1.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INP.

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    PROGRAM_NAME = SYST-CPROG

    DYNPRO_NUMBER = SYST-DYNNR

    • FIELD_NAME = ' '

    IMPORTING

    FILE_NAME = W_PATH1.

    IF W_PATH1 IS NOT INITIAL.

    MOVE W_PATH1 TO W_PATHUP1.

    MOVE W_PATH1 TO P_INP.

    ENDIF.

    START-OF-SELECTION.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = W_PATHUP1

    FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = '|'

    TABLES

    DATA_TAB = IT_GENFIN

    EXCEPTIONS

    FILE_OPEN_ERROR = 1

    FILE_READ_ERROR = 2

    NO_BATCH = 3

    GUI_REFUSE_FILETRANSFER = 4

    INVALID_TYPE = 5

    NO_AUTHORITY = 6

    UNKNOWN_ERROR = 7

    BAD_DATA_FORMAT = 8

    HEADER_NOT_ALLOWED = 9

    SEPARATOR_NOT_ALLOWED = 10

    HEADER_TOO_LONG = 11

    UNKNOWN_DP_ERROR = 12

    ACCESS_DENIED = 13

    DP_OUT_OF_MEMORY = 14

    DISK_FULL = 15

    DP_TIMEOUT = 16

    OTHERS = 17.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    IF NOT IT_GENFIN[] IS INITIAL.

    LOOP AT IT_GENFIN INTO WA_GENFIN.

    • Prepare the key for saving the text. Used in table STXH.

    CONCATENATE SY-MANDT

    WA_GENFIN-PLNTY

    WA_GENFIN-PLNNR

    WA_GENFIN-PLNKN

    WA_GENFIN-ZAEHL INTO LV_NAME.

    CALL FUNCTION 'INIT_TEXT'

    EXPORTING

    ID = 'PLPO'

    LANGUAGE = 'E'

    NAME = LV_NAME

    OBJECT = 'ROUTING'

    IMPORTING

    HEADER = LV_HEADER

    TABLES

    LINES = LT_LONG_INIT

    EXCEPTIONS

    ID = 1

    LANGUAGE = 2

    NAME = 3

    OBJECT = 4

    OTHERS = 5.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ELSE.

    • Split long text into table.

    LV_TEXT_LENGTH = STRLEN( WA_GENFIN-LONGTEXT ).

    LV_CHAR_POS_CURR = 0.

    LV_CHAR_POS_LAST = 0.

    LV_LOOP_TIMES = LV_TEXT_LENGTH DIV 80.

    DO LV_LOOP_TIMES TIMES.

    LV_CHAR_POS_CURR = LV_CHAR_POS_CURR + 80.

    LT_LONG_TEXT-TDLINE =

    WA_GENFIN-LONGTEXT+LV_CHAR_POS_LAST(80).

    LT_LONG_TEXT-TDFORMAT = '*'.

    APPEND LT_LONG_TEXT.

    LV_CHAR_POS_LAST = LV_CHAR_POS_CURR - 1.

    ENDDO.

    • Write the left-over.

    LT_LONG_TEXT-TDLINE = WA_GENFIN-LONGTEXT.

    • LV_LONGTEXT+LV_CHAR_POS_LAST.

    LT_LONG_TEXT-TDFORMAT = '*'.

    APPEND LT_LONG_TEXT.

    LT_LONG_TEXT-TDLINE = WA_GENFIN-LONGTEXT.

    • LV_LONGTEXT+LV_CHAR_POS_LAST.

    LT_LONG_TEXT-TDFORMAT = '*'.

    APPEND LT_LONG_TEXT.

    LT_LONG_TEXT-TDLINE = WA_GENFIN-LONGTEXT.

    • LV_LONGTEXT+LV_CHAR_POS_LAST.

    LT_LONG_TEXT-TDFORMAT = '*'.

    APPEND LT_LONG_TEXT.

    CALL FUNCTION 'SAVE_TEXT'

    EXPORTING

    CLIENT = SY-MANDT

    HEADER = LV_HEADER

    • INSERT = ' '

    SAVEMODE_DIRECT = 'X'

    • OWNER_SPECIFIED = ' '

    • LOCAL_CAT = ' '

    • IMPORTING

    • FUNCTION =

    • NEWHEADER =

    TABLES

    LINES = LT_LONG_TEXT

    EXCEPTIONS

    ID = 1

    LANGUAGE = 2

    NAME = 3

    OBJECT = 4

    OTHERS = 5

    .

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ELSE.

    CALL FUNCTION 'COMMIT_TEXT'.

    • EXPORTING

    • OBJECT = '*'

    • NAME = '*'

    • ID = '*'

    • LANGUAGE = '*'

    • SAVEMODE_DIRECT = ' '

    • KEEP = ' '

    • LOCAL_CAT = ' '

    • IMPORTING

    • COMMIT_COUNT =

    • TABLES

    • T_OBJECT =

    • T_NAME =

    • T_ID =

    • T_LANGUAGE =

    .

    WRITE:/ 'Text Updated for',WA_GENFIN-PLNTY,WA_GENFIN-PLNNR,

    WA_GENFIN-PLNKN,

    WA_GENFIN-ZAEHL.

    ENDIF.

    ENDIF.

    ENDLOOP.

    ENDIF.

    Regards,

    Prabaharan.G

    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.