ABAP Program global variable print at runtime

Hi,
  I have an abap program with more than 1000 global variables. I want to run the program and at a specific point show a report with names and runtime values of all the global variables in the program. Is there some system table which stores all the global variable names and source code? Kindly help.
Satya

Hello Satya,
You can store all your global variables in one internal table.
let's say your Itab contains 1000 fields. Now, if you want to retrive the name of the itab, you can use the system call.
DATA: IT_COMP LIKE RSTRUCINFO OCCURS 0 WITH HEADER LINE.
*-- Getting fields of internal table
  CALL 'AB_STRUC_INFO'
    ID 'PROGRAM'   FIELD SY-CPROG
    ID 'STRUCNAME' FIELD P_ITAB
    ID 'STRUCINFO' FIELD IT_COMP-SYS.
After getting all your fields in it_comp table you can use field symbol to get the values of your fields.
Regards,
Reward points, if it is useful...!

Similar Messages

  • Execute InfoPackage in ABAP program and Pass Values at runtime

    Hi All,
       I want to execute an InfoPackage in an ABAP program. I am looking to execute the Infopackage in a loop passing in different values to 0FISCPER under Data Selection tab in the InfoPackage at run time. Please help. I would appreciate if someone has code.
    Thanks.
    Regards,
    bw_newbie

    you can do the same thing with routine in data selection. why do you want to do it with ABAP Program? any specific Reason?
    You can achive this using BAPI_IPAK_START and BAPI_IPAK_CHANGE FM in ABAP Program.
    You need to pass Fiscal Period values in BAPI_IPAK_CHANGE FM.
    Nagesh Ganisetti.
    Assign points if it helps.

  • How does a global variable affect the runtime of optimisation-function fminsearch?

    Hi,
    my function "fmintest" needs 254s ~ 4min to finish calculation in Mathscript, while Matlab needs
    3s!!! I need the sorfware for data processing in a real time measuring system, where the calculation have to be done within 5 seconds.
    In the Mathscript-help I found the following (global -> details):
    If you call this function from a MathScript Node, LabVIEW operates with slower
    run-time performance for the MathScript Node. To optimize the performance of the
    MathScript Node, remove this function from scripts.
    How can I remove needed global variables in the fminsearch function handle? Is the system faster if I would/can remove the global variables?
    How can I avoid Mathscript-breakdown after saving changes to m-files and restarting them again?
    regards
    Attachments:
    ni3.7z ‏2 KB

    Hi,
    can you provid a VI and not only your m-files? It will be easier to help you!
    Can the customer provide a VI that demonstrates this behavior, rather than just providing the m files?
    Also, the Help file says fminsearch is not supported by the
    LabVIEW Run Time engine, so please take that in mind. If you want to build an application you cant use this function.
    Regards, RMathews

  • Use of global variables like g_cnt_transactions_transferred in the LSMW

    Hi SapAll.
    when i had a look at the some of the LSMW's whic use IDOC as the object of uploading data into SAP from external Files i have found in the coding under the step "Maintain Field Mapping and Conversion Rules" that they use some of the global variables like below
    .if p_trfcpt = yes or sy-saprl >= '46A'.
      EDI_DC40-DOCNUM = g_cnt_transactions_transferred + 1.
    endif.
    .EDI_DC40-CIMTYP = g_cimtyp.
    .EDI_DC40-MESTYP = g_mestyp.
    .EDI_DC40-MESCOD = g_mescod.
    .if p_filept = yes.
      EDI_DC40-SNDPOR = g_fileport.
    elseif p_trfcpt = yes.
      EDI_DC40-SNDPOR = g_trfcport.
    endif.
    my doubt is where i can find these variables 'g_cnt_transactions_transferred ','g_cimtyp','g_mescod','g_fileport','g_trfcport' in the LSMW and what is the use of the variable  'g_cnt_transactions_transferred ' in the LSMW.
    I have treid to find out the above listed variables looking in step 'Maintain Field Mapping and Conversion Rules' under global variabels list and the other lists also but i couldnt found.
    can any one help me in this ?
    regards.
    Seetha.

    Hi Seetha,
               In the LSMW Workbench go to the option user menu.  And check the option display conversion program.
    Now when you execute with the radio button on dislplay conversion program, you ll see the code that got generated in the background while you built your LSMW.
    The global variables that you have mentioned are bound to be there in this program generated in the background..
    You can put a break point here and see for yourself what the value of these global variables are at runtime.
    File port, TRFC port , no. of transactions executed by one run of the LMSW Idoc program , message type are some of the fields that you have asked for .
    Regards,
    Arun

  • Can F4IF_INT_TABLE_VALUE_REQUEST FM return a value in a global variable?

    Hi everybody,
    I need to use F4IF_INT_TABLE_VALUE_REQUEST FM because I have to let users select an specific option before choosing another value. The point is that I need to save in a program global variable what the user selects, and decide something with it in the program.
    Is it possible that F4IF_INT_TABLE_VALUE_REQUEST FM returns the value in a sinple variable or it has to be paramter?
    I look in a lot of previous threads but I didn't find anything, and I don't know if it's possible.
    Thanks and kind regards,
    MMP.

    Hi,
    Sure you can. All you need to do is to store what the function returns in your global variable. It don't need to be returned back to screen field.
    DATA: BEGIN OF VALUES OCCURS 0,
             CARRID TYPE SPFLI-CARRID,
             CONNID TYPE SPFLI-CONNID,
           END OF VALUES.
    DATA: VALUES_TAB TYPE TABLE OF VALUES,
              G_VALUE TYPE SPFLI-CONNID.  "global variable to store what is returned
    "in PAI first populate your table
      SELECT  CARRID CONNID
        FROM  SPFLI
        INTO  CORRESPONDING FIELDS OF TABLE VALUES_TAB
        UP TO 10 ROWS.
    "then call the function but don't return the value to screen field
    "If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the useru2019s selection is
    "returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the
    "selection is returned into the table instead.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                RETFIELD         = 'CONNID'
                VALUE_ORG        = 'S'
           TABLES
                VALUE_TAB        = VALUES_TAB
                RETURN_TAB      = RETURN_TAB.
    "now simply read first row of return tab and store the value returned there in some global var
    READ RETURN_TAB INDEX 1.
    MOVE RETURN_TAB-FIELDVAL TO G_VALUE.
    Regards
    Marcin

  • SAP naming conventions: customer DDIC objects, ABAP programming

    SAP Note 16466 Customer name range for SAP objects contains the SAP naming conventions for customer DDIC objects. Rule of thumb is that the names reserved for customer objects start with 'Y' or 'Z'. However, this note contains the naming convention for DDIC objects only.
    ABAP Code Inspector (transaction SCI) contains the following naming convention for ABAP programming:
    - Global types: T_
    - Global constants: C_
    - Global data: gv_
    - Global field-symbols: FS_
    - Global parameters: P_
    - Global select-options: S_
    - Global field-groups: FS_
    - Local types: LT_
    - Local constants: LC_
    - Local data: v_
    - Local field-symbols: LFS_
    This is the only place I know for ABAP programming naming convention. Does SAP has somewhere else any additional naming convention guidelines for ABAP programming?
    Thanks in advance for your help.
    Regards,
    Jarmo Tuominen

    Naming convention guidelines for ABAP programming is available in here: [Manage Successful Customer Development|https://websmp206.sap-ag.de/~sapidb/011000358700004444532001E].
    Naming Data Types and Objects
    The names of data types and objects have the form: <Classifier>_<Data type>_<Descriptor>.
    The names of data types and objects have up to 30 characters.
    Exceptions: names of input parameters and select options have up to 8 characters, and <Data type> and _ are omitted.
    First component: Classifier
    T Data type
    C  Constant
    G  Global data object
    L  Local data object
    FS Field symbol
    P  Input parameter
    S  Select option
    P  Formal parameter in form
    FM Formal parameter in function
    Second component: Data Type
    <t> Elementary data type, optionally followed by length
    C<n> Type C of length <n>
    N<l> Type N of length <n>
    X<l> Type X of length <n>
    D    Type D
    T    Type T
    I    Type I
    P<d> Type P with <d> decimals
    F    Type F
    WA  Work area
    IT  Internal table
    Third component: Descriptor
    Use meaningful English names. Later, your code may be maintained or analyzed by a programmer or support consultant who is not familiar with another language.
    Use only alphanumeric characters (A-Z and 0-9) and separate words with underscores (_). Hyphens are reserved for separating components in structured data types.
    Examples:
    G_I_COUNTER (global counter)
    T_IT_BOOKING_LIST (type for list of bookings)
    G_IT_BOOKINGS (global internal table of bookings)
    PSMOKER (input parameter for smoker flag: note omission of data type and _ for brevity)
    Edited by: Jarmo Tuominen on Feb 21, 2011 2:13 PM

  • How can i print data in smartforms from ABAP program.

    Dear gurus:
    in my abap program i process require data, and saved in a internal table.
    how can l print the data in smartforms.?
    who can give me a code sample is better:)
    reward all helpful advise.

    Try this....
    1) Tcode --> SmartForms
    2) Form name --> Z_SF_TEST Create
    3) Under Global settings
    a) Form Interface  
        Table Tab
       ITAB LIKE EKPO
    b) GLOBAL Definitions
    WA_NETPR LIKE EKPO-NETPR
    In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
    For that we have to create an extra variable in global definitions
    Ex: netpr FIELD of EKPO
    CREATE program lines and specify WA_NETWR = itab-netpr.
    4) RT CLick on main Window
       CREATE --> TABLE
      Click Table painter
    DEFAULT %LTYPE will be Created
    a) If you want more like Header footer etc add by rt click on %LTYPE1
    Table (Tab)
    %LTYPE  Radio(SELECT) 5 CM 5 CM 6 CM
    CLICK on DATA (Tab)
    INTERNAL TABLE ITAB LIKE ITAB
    5)RT click on table control and create --> program lines
    General attribute (Tab)
    INPUT PARAMETER               OUTPUT PARAMETER
    itab                               WA_NETPR
    Code Area
    WA_NETWR = ITAB-NETPR.
    6) RT CLcick on table ctl and create 3 text to display the fields
    a) % text1 +button(insert field)
       FIELD name &itab-ebeln&
    Output options (tab)
    Check New line   LINETYPE   %Ltype1
    check new cell
    b) % text2
       & itab-ebelp&
    output options
    check new cell
    c) % text2
       & wa_netpr&
    output options
    check new cell
    <b>Report ac
    Tables ekpo.
    Data: itab1 like ekpo occurs 0 with header line.
    select * into table itab1 from ekpo.
    Call function module --> smart form function module and pass your internal table</b>
    Regards,
    SaiRam

  • ABAP Query: Access variables in ABAP Program through InfoSet Query.

    Hi,
    While generating a report using ABAP Query Tool, how can we access the variables in the ABAP Program in the InfoSet Query?
    Thanks in Advance!!!

    HI,
    Dear, it seems that you have changed the query in SQ02 and then just save it and not generated.
    or may be after generation again clicked on SAVE button.
    So untill unless you will not generate the query, it won't work.
    Secondly, by chanegs in the query, i don't think it changes the name of the main program.
    Regds,
    Anil

  • Print an existing spool in ABAP program.

    Hi Experts, 
    I have a problem to print an existing spool. 
    I need print many an existing spools in ABAP program 
    - I used the SHDB and call transaction with BDC data but work only for 1st. 
    - I tried use the RSPO_RPRINT_SPOOLREQ function but don't work.

    I resolved my own problem.
    I use the function RSPO_OUTPUT_SPOOL_REQUEST...
    The only parameters to this functions was spool_request_id  - ID spool.
    Thanks for  help!

  • Creating abap program to develop and activate a global table type and global structure.

    Hi friends,
    I want to create and activate a global structure and global table type by coding in ABAP editor only. so can I do that anyhow.
    Please help me.
    Thanks in advance.

    Thanks guys for your fruitful replies, as most of you asked the main purpose of my question, the answer is as follows:
    in fact my purpose to do so is to create a function module that can fetch data dynamically from different database tables based on the codings in different abap program.
    for example: in one abap program i am coding as follows:
    tables: kna1.
    types: begin of itab,
              kunnr type kna1-kunnr,
              name1 type kna1-name1,
              end of itab.
    data: it_tab type standard table of itab,
             wa_tab type itab.
    similarly in other program i am coding as follows:
    tables: vbrp.
    types: begin of itab,
              posnr type vbrp-posnr,
              matnr type vbrp-matnr,
              arktx type vbrp-arktx,
              end of itab.
    data: it_tab type standard table of itab,
             wa_tab type itab.
    so now for both programs i want to call the same function module and fetch data as required in relative programs as mentioned above. in that case how to create that function module?

  • How to build labview global variable into dll?And how to use it in vc++ program?

    Hi!
       I want to build labview application into dll and use vc++ to call it.The labview program is a little complex,for it has many interface to vc++ and has while loop in it.When I use vc++ to call it,I must use vc++ to do other things.That is to say,vc++ creates a new thread to provide for the labview dll to run.the vc main thread goes on to other things.But the vc++ main thread must communicate with the labview dll by setting its inputs' parameters and get the results of running labview dll.Can you advise me how to realize it?
       I think global variable of labview could be useful when realizing the communication betweeb vc thread and labview dll.So I want to ask whether the labview global variable could also be built into dll and use it.Could you please tell me how to realize my idea?
       Thank you!

    [email protected] wrote:
    Hi!
    I want to build labview application into dll and use vc++ to call
    it.The labview program is a little complex,for it has many interface to
    vc++ and has while loop in it.When I use vc++ to call it,I must use
    vc++ to do other things.That is to say,vc++ creates a new thread to
    provide for the labview dll to run.the vc main thread goes on to other
    things.But the vc++ main thread must communicate with the labview dll
    by setting its inputs' parameters and get the results of running
    labview dll.Can you advise me how to realize it?
       I
    think global variable of labview could be useful when realizing the
    communication betweeb vc thread and labview dll.So I want to ask
    whether the labview global variable could also be built into dll and
    use it.Could you please tell me how to realize my idea?
       Thank you!
    You
    can't access LabVIEW globals directly from a caller to the LabVIEW DLL.
    However there is no problem in providing specific accessor VI functions
    to that global and export them as additional functions from the DLL.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to print external file using ABAP program

    Hello
    I want to print an external file which is located in server (
    20.99.0.18\GUI\xyz\8.0QUALITY\QM_TS.DOC) .....i want to print these kind of files(which i have retrieved from table 'DRAW' field 'filep' )......i need to print these files using ABAP program.
    thank you
    Vikram.
    Message was edited by:
            Vikram Bojja

    extract the data and pass to script or smartform for printing

  • Unicode Printing in ABAP program

    Hi all,
    I have a problem in Unicode printing. When I write a report, I use Unicode font. Everything is Ok when I print preview this report. But when i send it to the printer, the unicode font doesn't present.
    Do you know how to solve this problem ?
    Thank you very much.
    Sylvecast.

    Hi Atish,
    Yes, of course. I can print any word document with unicode font. I don't know if there must have any settings in ABAP program ? But when i print preview it, evrey thing is OK.
    Kindly regards,
    Sylvecast.

  • Newbie question: Send data to printer from ABAP program

    Hello, I am a newbie.
    I do not use  SAPScript nor SmartForms.
    But I need to send a printer command stream from my ABAP to printer.
    Is it possible?
    How can this be possible? Please give me some guideline.
    I will reward you points. Promise.
    Thanks

    hi,
    u can send ur program details to printer using submit to sap-spool statement.
    SUBMIT TO SAP-SPOOL
    Basic form
    SUBMIT rep ... TO SAP-SPOOL.
    Extras:
    1.... DESTINATION dest         ... COPIES cop
            ... LIST NAME name
            ... LIST DATASET dsn
            ... COVER TEXT text
            ... LIST AUTHORITY auth
            ... IMMEDIATELY flag
            ... KEEP IN SPOOL flag
            ... NEW LIST IDENTIFICATION flag
            ... DATASET EXPIRATION days
            ... LINE-COUNT lin
            ... LINE-SIZE  col
            ... LAYOUT layout
            ... SAP COVER PAGE mode
            ... COVER PAGE flag
            ... RECEIVER rec
            ... DEPARTMENT dep
            ... ARCHIVE MODE armode
            ... ARCHIVE PARAMETERS arparams
            ... WITHOUT SPOOL DYNPRO
    2. ... SPOOL PARAMETERS params
             ... ARCHIVE PARAMETERS arparams
             ... WITHOUT SPOOL DYNPRO
    3. ... Further parameters (for passing variants)
            are described in the documentation for SUBMIT
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Missing print parameters with SUBMIT.
    Effect
    Calls the report rep with list output to the SAP spool database.
    Additions
    ... DESTINATION dest(output device)
    ... COPIES cop(number of copies)
    ... LIST NAME name(name of list)
    ... LIST DATASET dsn(name of spool dataset)
    ... COVER TEXT text(title of spool request)
    ... LIST AUTHORITY auth(authorization for display)
    ... IMMEDIATELY flag(print immediately ?)
    ... KEEP IN SPOOL flag(keep list after print ?)
    ... NEW LIST IDENTIFICATION flag(new spool request ?)
    ... DATASET EXPIRATION days(number of days list
    retained)
    ... LINE-COUNT lin ( lin lines per page)
    ... LINE-SIZE  col(col columns per line)
    ... LAYOUT layout(print format)
    ... SAP COVER PAGE mode(SAP cover sheet ?)
    ... COVER PAGE flag(selection cover sheet ?)
    ... RECEIVER rec(SAP user name of
    recipient)
    ... DEPARTMENT dep(name of department)
    ... ARCHIVE MODE armode(archiving mode)
    ... ARCHIVE PARAMETERS arparams(structure with archiving
    parameters)
    ... WITHOUT SPOOL DYNPRO(skip print control screen)
    With the parameters IMMEDIATELY, KEEP IN SPOOL, NEW LIST IDENTIFICATION and COVER TEXT, flag must be a literal or character field with the length 1. If flag is blank, the parameter is switched off, but any other character switches the parameter on. You can also omit any of the sub-options of PRINT ON. mode with SAP COVER PAGE can accept the values ' ', 'X' and 'D'. These values have the following meaning:
    ' ' : Do not output cover sheet
    'X' : Output cover sheet
    'D' : Cover sheet output according to printer setting
    armode with ARCHIVE MODE can accept the values '1', '2' and '3'. These values have the following meaning:
    '1' : Print only
    '2' : Archive only
    '3' : Print and archive
    arparams with ARCHIVE PARAMETERS must have the same structure as ARC_PARAMS. This parameter should only be processed with the function module GET_PRINT_PARAMETERS.
    Effect
    Output is to the SAP spool database with the specified parameters. If you omit one of the parameters, the system uses a default value. Before output to the spool, you normally see a screen where you can enter and/or modify the spool parameters. However, you can suppress this screen with the following statement:
    ... TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    You could use this option if all the spool parameters have already been set!
    Note
    When specifying the LINE-SIZE, you should not give any value > 132 because most printers cannot print wider lists.
    Addition 2
    ... SPOOL PARAMETERS params(structure with print
    parameters)
    ... ARCHIVE PARAMETERS arparams(Structure with archive
    parameters)
    ... WITHOUT SPOOL DYNPRO(skip print parameters
    screen)
    Effect
    Output is to the SAP spool database with the specified parameters. The print parameters are passed by the field string params which must have the structure of PRI_PARAMS. The field string can be filled and modified with the function module GET_PRINT_PARAMETERS. The specification arparams with ARCHIVE PARAMETERS must have the structure of ARC_PARAMS. This parameter should only be processed with the function module GET_PRINT_PARAMETERS. Before output to the spool, you normally see a screen where you can enter and/or modify the spool parameters. However, you can suppress this screen with the following statement:
    ... WITHOUT SPOOL DYNPRO
    Example
    Without archiving
    DATA: PARAMS LIKE PRI_PARAMS,
          DAYS(1)  TYPE N VALUE 2,
          COUNT(3) TYPE N VALUE 1,
          VALID    TYPE C.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING DESTINATION           = 'LT50'
                COPIES                = COUNT
                LIST_NAME             = 'TEST'
                LIST_TEXT             = 'SUBMIT ... TO SAP-SPOOL'
                IMMEDIATELY           = 'X'
                RELEASE               = 'X'
                NEW_LIST_ID           = 'X'
                EXPIRATION            = DAYS
                LINE_SIZE             = 79
                LINE_COUNT            = 23
                LAYOUT                = 'X_PAPER'
                SAP_COVER_PAGE        = 'X'
                COVER_PAGE            = 'X'
                RECEIVER              = 'SAP*'
                DEPARTMENT            = 'System'
                NO_DIALOG             = ' '
      IMPORTING OUT_PARAMETERS        = PARAMS
                VALID                 = VALID.
    IF VALID <> SPACE.
      SUBMIT RSTEST00 TO SAP-SPOOL
        SPOOL PARAMETERS PARAMS
        WITHOUT SPOOL DYNPRO.
    ENDIF.
    Example
    With archiving
    DATA: PARAMS   LIKE PRI_PARAMS,
          ARPARAMS LIKE ARC_PARAMS,
          DAYS(1)  TYPE N VALUE 2,
          COUNT(3) TYPE N VALUE 1,
          VALID    TYPE C.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING DESTINATION            = 'LT50'
                COPIES                 = COUNT
                LIST_NAME              = 'TEST'
                LIST_TEXT              = 'SUBMIT ... TO SAP-SPOOL'
                IMMEDIATELY            = 'X'
                RELEASE                = 'X'
                NEW_LIST_ID            = 'X'
                EXPIRATION             = DAYS
                LINE_SIZE              = 79
                LINE_COUNT             = 23
                LAYOUT                 = 'X_PAPER'
                SAP_COVER_PAGE         = 'X'
                COVER_PAGE             = 'X'
                RECEIVER               = 'SAP*'
                DEPARTMENT             = 'System'
                SAP_OBJECT             = 'RS'
                AR_OBJECT              = 'TEST'
                ARCHIVE_ID             = 'XX'
                ARCHIVE_INFO           = 'III'
                ARCHIVE_TEXT           = 'Description'
                NO_DIALOG              = ' '
      IMPORTING OUT_PARAMETERS         = PARAMS
                OUT_ARCHIVE_PARAMETERS = ARPARAMS
                VALID                  = VALID.
    IF VALID <> SPACE.
      SUBMIT RSTEST00 TO SAP-SPOOL
        SPOOL PARAMETERS PARAMS
        ARCHIVE PARAMETERS ARPARAMS
        WITHOUT SPOOL DYNPRO.
    ENDIF.

  • Runtime error:ABAP program lines are longer than the internal table

    Hi all,
    Below is the code I have written,when Iam running it Iam getting
    'ABAP program lines are longer than the internal table' runtime error.How can I resolve it.
    REPORT  ZTEST1  NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES:MARC,CDHDR,CDPOS.
    TYPE-POOLS:SLIS.
    DATA:HEADER TYPE SLIS_T_FIELDCAT_ALV,
         WA TYPE SLIS_FIELDCAT_ALV,
         LAYOUT TYPE SLIS_LAYOUT_ALV.
    TYPES:BEGIN OF MARC_TY,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            EKGRP LIKE MARC-EKGRP,
            MINBE LIKE MARC-MINBE,
            EISBE LIKE MARC-EISBE,
            MABST LIKE MARC-MABST,
           END OF MARC_TY.
    TYPES:BEGIN OF MATNR1_TY,
            MATNR1 LIKE CDHDR-OBJECTID,
          END OF MATNR1_TY.
    TYPES:BEGIN OF CDHDR_TY,
             OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
             OBJECTID   LIKE CDHDR-OBJECTID,
             CHANGENR   LIKE CDHDR-CHANGENR,
             USERNAME   LIKE CDHDR-USERNAME,
             UDATE      LIKE CDHDR-UDATE,
            END OF CDHDR_TY.
    TYPES:BEGIN OF CDPOS_TY,
             OBJECTCLAS LIKE CDPOS-OBJECTCLAS,
             OBJECTID   LIKE CDPOS-OBJECTID,
             CHANGENR   LIKE CDPOS-CHANGENR,
             TABNAME    LIKE CDPOS-TABNAME,
             FNAME      LIKE CDPOS-FNAME,
             CHNGIND    LIKE CDPOS-CHNGIND,
             VALUE_NEW  LIKE CDPOS-VALUE_NEW,
             VALUE_OLD  LIKE CDPOS-VALUE_OLD,
            END OF CDPOS_TY.
    **************TABLE TYPES********************************************
    TYPES: MARC_TAB   TYPE TABLE OF MARC_TY,
           MATNR1_TAB TYPE TABLE OF MATNR1_TY,
           CDHDR_TAB  TYPE TABLE OF CDHDR_TY,
           CDPOS_TAB  TYPE TABLE OF CDPOS_TY.
    *******************INTERNAL TABLES************************************
    DATA:MARC_ITAB   TYPE MARC_TAB,
         MATNR1_ITAB TYPE MATNR1_TAB,
         CDHDR_ITAB  TYPE CDHDR_TAB,
         CDPOS_ITAB  TYPE CDPOS_TAB.
    ****************WORK AREAS********************************************
    DATA:MARC_WA   TYPE MARC_TY,
         MATNR1_WA TYPE MATNR1_TY,
         CDHDR_WA  TYPE CDHDR_TY,
         CDPOS_WA  TYPE CDPOS_TY.
    *******************SELECTION-SCREEN***********************************
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
      PARAMETERS:PLANT LIKE MARC-WERKS.
      SELECT-OPTIONS:MATERIAL FOR MARC-MATNR.
      SELECT-OPTIONS:DATE FOR CDHDR-UDATE.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
    SELECT MATNR
            WERKS
            EKGRP
            MINBE
            EISBE
            MABST
            FROM MARC INTO TABLE MARC_ITAB
            WHERE MATNR IN MATERIAL
            AND WERKS = PLANT.
      CHECK MARC_ITAB[] IS NOT INITIAL.
      LOOP AT MARC_ITAB INTO MARC_WA.
       MATNR1_WA-MATNR1 = MARC_WA-MATNR.
       APPEND MATNR1_WA TO MATNR1_ITAB.
       CLEAR MATNR1_WA.
    ENDLOOP.
    CHECK MATNR1_ITAB[] IS NOT INITIAL.
    SELECT OBJECTCLAS
            OBJECTID
            CHANGENR
            USERNAME
            UDATE
            FROM CDHDR INTO TABLE CDHDR_ITAB
            FOR ALL ENTRIES IN MATNR1_ITAB
            WHERE OBJECTCLAS = 'MATERIAL'
            AND OBJECTID = MATNR1_ITAB-MATNR1
            AND UDATE IN DATE.
    CHECK CDHDR_ITAB[] IS NOT INITIAL.
    SORT CDHDR_ITAB[]  DESCENDING BY OBJECTID  CHANGENR.
    DELETE ADJACENT DUPLICATES FROM CDHDR_ITAB[] COMPARING OBJECTID.
    SELECT OBJECTCLAS
           OBJECTID
           CHANGENR
           TABNAME
           FNAME
           CHNGIND
           VALUE_NEW
           VALUE_OLD
           FROM CDPOS INTO CORRESPONDING FIELDS OF TABLE CDPOS_ITAB
           FOR ALL ENTRIES IN CDHDR_ITAB
           WHERE OBJECTCLAS = CDHDR_ITAB-OBJECTCLAS
           AND OBJECTID = CDHDR_ITAB-OBJECTID
           AND CHANGENR = CDHDR_ITAB-CHANGENR
           AND TABNAME  = 'MARC'
           AND FNAME    IN ('MINBE','EISBE','MABST','LVORM')
           AND CHNGIND  = 'U'.
    CHECK CDPOS_ITAB[] IS NOT INITIAL.
    *LOOP AT CDPOS_ITAB INTO CDPOS_WA.
    WRITE: / CDPOS_WA-OBJECTCLAS,
             CDPOS_WA-OBJECTID,
             CDPOS_WA-CHANGENR,
             CDPOS_WA-TABNAME,
             CDPOS_WA-FNAME,
             CDPOS_WA-CHNGIND,
             CDPOS_WA-VALUE_NEW,
             CDPOS_WA-VALUE_OLD.
    *ENDLOOP.
    WA-SELTEXT_L = 'OBJECTCLAS'.
    WA-COL_POS   = '1'.
    WA-FIELDNAME = 'OBJECTCLAS'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '15'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'OBJECTID'.
    WA-COL_POS   = '2'.
    WA-FIELDNAME = 'OBJECTID'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '20'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'CHANGENR'.
    WA-COL_POS   = '3'.
    WA-FIELDNAME = 'CHANGENR'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '8'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'TABNAME'.
    WA-COL_POS   = '4'.
    WA-FIELDNAME = 'TABNAME'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '5'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'FNAME'.
    WA-COL_POS   = '5'.
    WA-FIELDNAME = 'FNAME'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '7'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'CHANGING'.
    WA-COL_POS   = '6'.
    WA-FIELDNAME = 'CHANGING'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '1'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'VALUE_NEW'.
    WA-COL_POS   = '7'.
    WA-FIELDNAME = 'VALUE_NEW'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '5'.
    APPEND WA TO HEADER.
    CLEAR WA.
    WA-SELTEXT_L = 'VALUE_OLD'.
    WA-COL_POS   = '8'.
    WA-FIELDNAME = 'VALUE_OLD'.
    WA-TABNAME   = 'CDPOS_ITAB'.
    WA-OUTPUTLEN = '5'.
    APPEND WA TO HEADER.
    CLEAR WA.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
        I_PROGRAM_NAME               = SY-REPID
        I_INTERNAL_TABNAME           = 'CDPOS_ITAB'
        I_CLIENT_NEVER_DISPLAY       = 'X'
        I_INCLNAME                   = SY-REPID
      CHANGING
        CT_FIELDCAT                  = HEADER[]
    EXCEPTIONS
    IF SY-SUBRC <> 0.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = SY-REPID
        IT_FIELDCAT                       = HEADER[]
      TABLES
        T_OUTTAB                          = CDPOS_ITAB[]
    IF SY-SUBRC <> 0.
    ENDIF.

    Your select querry on MARC is not matching with MARC_TY.
    The field in the MARC table and MARC_TY should be same.
    and also, when you are making select querry on CDPOS table
    with all entries.
    When ever you are using all entries select statement, you should check whether the internal table is having value.
    you should check
    if CDPOS_IT[] is not initial.
    SELECT OBJECTCLAS
    OBJECTID
    CHANGENR
    TABNAME
    FNAME
    CHNGIND
    VALUE_NEW
    VALUE_OLD
    FROM CDPOS INTO CORRESPONDING FIELDS OF TABLE CDPOS_ITAB
    FOR ALL ENTRIES IN CDHDR_ITAB
    WHERE OBJECTCLAS = CDHDR_ITAB-OBJECTCLAS
    AND OBJECTID = CDHDR_ITAB-OBJECTID
    AND CHANGENR = CDHDR_ITAB-CHANGENR
    AND TABNAME = 'MARC'
    AND FNAME IN ('MINBE','EISBE','MABST','LVORM')
    AND CHNGIND = 'U'.
    endif.
    Regards
    Madhan D

Maybe you are looking for

  • New field in VL31N ( LE_SHP_TAB_CUST_ITEM )

    Hi experts, I need to include a new field (LIPS-VFDAT) in Item Overview tab in Tx VL32N. I've read some about it, and it seems that i have to use BAdI  LE_SHP_TAB_CUST_ITEM. Anyone can tell me how to use it? Thanks FC

  • Is there a way to block the inappropriate content in the podcasts app?

    Hello, I am a husband, father and pastor and do a lot of podcast listening throughout the week, but was recently very disappointed to find some very adult content in the podcasts app under "top stations," with seemingly no way to block or monitor pod

  • Has Photoshop CS5 Extended added a "Behind" and "Clear" in MODE drop down box?

    Hi Guys, I am not sure what just happened with my PS. Was downloading and installing some custom patterns and brushes from the net last night. And when I went to try them out I noticed the drop down box had 2 new added effects ( Behind and Clear ) wh

  • Progress bar in Table ivew

    Hi all, is it possible to have a progress bar a table view? After some test I have not got the result I need: I have set, in the expression field for that progress bar column, a numeric field (the numeric field belongs to the custom table I am readin

  • Cannot find the class file for javax.microedition.io.ContentConnection

    I've downloaded and configured eclipse j2me plugin and am having no difficulty creating Midlets according to the eclipse documentation http://eclipseme.org/docs/createProject.html (Also I have sun java wireless toolkit 2.5.2) (I have imported wtk252