Cumulate values in structure and formulas

Hello,
I created the query and used the structure in rows. But in this structure I can´t use the possibillity with cumulate values. Do you know where is the problem?
I have also problems with cumulate data in formulas - I count rate of costs in two years. In colums I have cumulate values but the formula, which count the rate don´t use the cumulate values.
Thanks for you advices.
Regard
Petr

Thanks, but when I use the structure this opportunity don´t operate. Below you can see the result which I have, but I want to get cumulate date in colums and rate which operate with cumulate date.
2006      2007     rate
-9 905     -15 120     1,5266
-19 294     -18 972     0,9833
-3 931     -6 678     1,6988
-11 821     -13 935     1,1788
-16 144     -26 749     1,6569
-17 075     -10 294     0,6029
-22 715     -13 006     0,5726
-9 648     -10 206     1,0579
-1 631     -11 895     7,2953
-16 231     -20 033     1,2343
-14 489     -20 293     1,4005
-19 365     -23 894     1,2339
Thanks

Similar Messages

  • How to pass values in dynamic structure and then dynamic table

    Hi,
    we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
    I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic  table type is any its not allowing an index operation like modify etc etc.
    Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure  and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.

    Hi Friends,
    This is the piece of code.After creating dynamic work area and dynamic table what i should do?
    TYPES: BEGIN OF STR,
    ID TYPE I,
    NAME(30) TYPE C,
    END OF STR.
    data: v_lines type i.
    STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
    STR_COMP = STR_TYPE->GET_COMPONENTS( ).
    APPEND LINES OF STR_COMP TO COMP_TAB.
    COMP-NAME = 'NAME1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING(  ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
    NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
    P_LINE_TYPE = NEW_STR
    P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
    P_UNIQUE = ABAP_FALSE ).
    CREATE DATA DREF TYPE HANDLE NEW_TAB.
    CREATE DATA DREF1 TYPE HANDLE NEW_str.

  • Calculate maximum value of subarray while creating it using a case structure and shift registers

    I have two 1D arrays that contain cyclical information (kind of like a sine wave).  One that contains information on position in degrees and another that contains torque.  I would like to calculate the maximum torque value each time the position is within a certain range (e.g. from 30-80 degrees).  The ranges are repeated - that's why it is cyclical.   I use the "in range" function, a case structure and shift registers to build a new array with values that fall within the range I specify - this was the easy part (see VI attached).  I'm struggling with a way to calculate a maximum value for each subarray formed when values are "in range".   Your help is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    Simple Calculate between anatomical position range.vi ‏16 KB

    It's not really noise - it's more inconsistency.  So a position output can run: 20, 30, 40, 50, 60 etc.  OR, it could run: 21, 24, 32, 41, 44, 51, 59 etc. But, it is always cyclical. 
    Attached you will find a .csv file with the data arrays - I'm using POS (ANAT) degrees column (column D if you open in excel).  There you also see torque in ft-lbs along with some other information.
    Attachments:
    025C.csv ‏224 KB

  • Org Specific Purchasing Category Structure and Values

    Hi
    I have an instance with 2 separate organisations defined under 1 business group. Each organisation requires its own purchasing category structure and values.
    I cant seem to be able to achieve setting each org with its own values using a different category set, even when I configure the category set to be controlled by organisation. Let alone each org having its own flexfield segment configuration i.e one has 3 segments 1 has 4.
    Is there anyway to achieve this in my current org structure, or do i have to create a business group for each organisation and seperate them that way to achieve this?
    Thanks
    James

    Hi Sandeep
    I have setup 2 different category sets, each controlled at org level, and then assigned them as the default category set for purchasing. However when i set it for one org it overwrites whats configured for the other org?
    Do you know why i cant seperate them?
    Thanks
    James

  • Query Designer in BI - How to cumulate value and get the Max and Min value.

    I want to create a report with  query designe of BI 7r. is it possible. the data from the cube will be
    Year ,           Exposed Quantity
    1999 ,             200
    2000 ,            100
    2001 ,            -100
    2002 ,             300
    2003 ,           - 200
    2004 ,             100
    2005 ,            -200
    Calculation should be - Refer the cumulative value field
    Year  ,          Exposure Quantity ,   Cumulative value
    1999  ,            200   ,                             200
    2000  ,            100  ,                              300
    2001  ,           -100 ,                               200
    2002  ,            300  ,                              500
    2003  ,          - 200  ,                              300
    2004  ,            100  ,                              400
    2005  ,           -200  ,                              -200
    An the out put of the report  should be Max value ie 500 and Min Value -200.
    My question is that is it possible to do in the front end ie in the Query Designer (BI 7) If so how.
    Edited by: Parakadavil Chacko Mathew on Oct 8, 2009 3:52 AM

    Hi there,
    Create 4 column,
    1st will show regular values for the key figure,
    2nd will show Cumulative value, in Query Designer, Just right click on the this 2nd key figure properties, calculation tab there you can check on Cumulated option, and define the calculation direction as Calculate along the Column.
    3rd will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as minimum.
    4th will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as Maximum.
    Regards,
    Rajdeep Rane.

  • Numbers' Functions and Formulas in Multiple Cells, Tables, and Sheets

    Hello,
    I'm stuck with specifics that center around usage, and I get the funny feeling I'm overlooking a simple detail or two.
    If I may, here goes.
    I'm working with a single spreadsheet that has several sheets within it, and each sheet has an identical table. Each table is used to record various data, and I use an additional table in a separate sheet to consolidate some of the information, so that I can track results, at a glimpse, by looking at averages, totals, etc.
    Each data table is organized for consolidation by tracking wins, ties, or losses. It is important to know that each data table only records a single win, tie, or loss along with its other applicable data. And on the actual consolidation table I am trying to tally specific data fields by the use of Numbers' functions and formulas, yet I wish to keep these tallied results organized by the determining factor of whether or not they were gathered from a table that recorded a win, a table that recorded a tie, or a table with a loss.
    To illustrate, each table contains data fields that record start time, finish time, elapsed time, the day of the week, etc. Let's say I have eight tables, and the first two are winning tables, three more are tables that record a tie, and the last three are losing tables. For example, on my consolidated data table I wish to enter a function and formula capturing which of the eight tables are wins, ties, and losses so that I can, at a glance, see how much time elapsed to obtain the wins, ties, and losses. So then, in this example, for wins I want to determine which of those wins took 20 minutes, or which of them took 15 minutes, etc. So then, out of the two wins, let's say both of them took 20 minutes each. I need the numeral 2 to be counted and recorded on the consolidation table since only two tables match the criteria. And I would do the same for all remaining data fields (e.g., start time, finish time, etc.). Just so long as everything is determined by wins, ties, and losses, and then organized by the respective data fields. Simply put, this example determines a total of two wins that meet the data field requirement of 20 minutes. Out of the eight tables (one table per sheet) any other wins would then be organized according to the specific data in the elapsed time data field on it's data table (e.g., 5 minutes, 15 minutes, etc.).
    The exact syntax structure of the functions and formula I'm unsuccessfully using follows below. It only seems to return a result of 1, and I think it is returning this value from the IF Statements. By the way, the Win, Tie, or Loss cell in each data table is cell formatted as a pop-up so I can either select None or 1. But in this example I'm basing this on the time period of 20 minutes, and out of the eight data tables I have two wins which also record the time period as 20 minutes, so I should see 2 and not 1 in the 20 minutes column of the consolidated data table. Also, I tried changing the syntax where I would type "=1" in the IF Statements, but it returned a result of =1, and if I don't include the equals sign and quotation marks the result just shows up as 1.
    My Syntax:
    IF(Trade 1::'Data Recorded (1)' '* Win', 1, IF(Trade 2::'Data Recorded (1)' '* Win',1, IF(Trade 3::'Data Recorded (1)' '* Win',1, IF(Trade 4::'Data Recorded (1)' '* Win',1, IF(Trade 5::'Data Recorded (1)' '* Win',1, IF(Trade 6::'Data Recorded (1)' '* Win',1, IF(Trade 7::'Data Recorded (1)' '* Win',1, IF(Trade 8::'Data Recorded (1)' '* Win',1, IF(COUNTIFS(Trade 1::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 2::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 3::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 4::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 5::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 6::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 7::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 8::'Data Recorded (1)' '* Time in Trade (in minutes)'))))))))))
    Please bear in mind that the COUNTIFS portion of the above syntax structure is something I'm already successfully using to count the totals of other things not mentioned above, and I'm hesitant to delete it since it already works to my satisfaction when I want to, for example, determine the total number of overall wins. So, just for illustration purposes, I might have an overall wins column in my consolidation table that records how many wins there are, regardless of organization by elapsed time, or any other data field. In other words, the COUNTIFS syntax structure already works to my satisfaction. I'm not sure if it's possible to alter it so that it isn't so long, but what's there does work just when counting total numbers, as just mentioned.
    In summary, I'm wondering which function I can use with the COUNTIFS function to determine which of my eight data tables are winning tables, but break those wins down further based on criteria like elapsed time, and in the above example the time elapsed is 20 minutes. As you may see above, I'm unsuccessfully using the IF function. Finally, I've looked at the function browser descriptions of things like LOOKUP, HLOOKUP, VLOOKUP, INTERSECT.RANGES, and a few others. And so far I haven't made good use of any of them the way I've done when I use the COUNTIFS function by itself when only counting overall totals. But now I must determine totals that meet certain criteria, as explained above.
    Please help if you dare (smile). This is a huge project I'm undertaking, and so as not to cause confusion I have not included all of the details. But rather, I've taken a small sampling and set it to the side for experimentation. If this small sample works out to my satisfaction I can simply copy and paste the syntax in all other respective cells in the consolidation table, changing only reference locations, and perhaps conditions or values. One thing is certain, I don't intend on giving up on it.
    Thank you for your time and advice.
    Blessings!
    Message was edited by: solo68
    Added image.

    I'd like to edit the last paragraph of my second posting, but for some reason an entirely new posting is being created when I attempt to do this. So when reading this post, please use it to replace only the last paragraph of my second post containing the four inserted images.
    Last paragraph begins:
    In closing, I need each cell in each column of each row in my consolidation table to remain as is. I have my reasons for doing this, and they all serve a specific purpose. The only exception would be the formatting of the last three rows as footer rows. Most importantly, and I should have made this abundantly clear earlier, my apologies, I need a single function and formula in cell E7 of my consolidation table that will firstly determine which data tables are winning tables while secondly and simultaneously counting which of those winning tables have elapsed times of 20 minutes. Perhaps, now this better explains why my syntax is written the way it is written. In the example I provided, if the proper function and formula were written it would result as 2 in cell E7 in my consolidation table. If there is anything else specific you need of me in order to assist me, please request it. Thank you.
    Last paragraph ends:
    Additionally, to t quinn:
    First off, thank you for returning to assist me. I really do appreciate your efforts. Please be aware that I'm avoiding going into details about each and every portion of my spreadsheet because I wish to avoid discussion that is off topic. As I stated earlier, I'm new to using these features of Numbers. My spreadsheet encompasses a much larger amount of data than I'm referring to in the example in my first post. But in my example I'm isolating just the information concerning what I'm now trying to accomplish to finish my spreadsheet project. Moreover, most of what I've done up to this point I was able to figure out on my own, or get help from watching videos on YouTube, or simply using the application help menu. Please be aware that I consulted all of these, repeatedly. I even contacted AppleCare, and was told this sort of support is not available. In spite of this, I've accomplished a great deal in my first large spreadsheet project. Please be aware that when I wrote my second post and specifically responded to you, I didn't want to be rude or ungrateful, and I still don't, but maybe the suggestions you and Hiroto made about gathering the count of wins, ties, and losses are something I've already done. I think I've done that separately. These counts are already in separate cells, and they are working fine. In my first post where I inserted only one image you can see examples of this in my consolidation table image, in cells B3 and E6. I apologize for not making this abundantly clear earlier. Furthermore, the portion of my syntax that shows the COUNTIFS is the exact way I accomplished this, and it is written the way it is written because I need separate sheets, each with their own data tables. Again, in cell E7 I need to determine which of the eight data tables that record wins are also recording 20 minutes, but I need this in a single function and formula with the result appearing only in cell E7. Once this is figured out I will adjust the syntax to do the same thing with every column (these are not shown but they exist) in my consolidation table for the last three footer rows, named Win Column Totals, Tie Column Totals, and Loss Column Totals. The last three rows being footer rows may not be necessary, and if so, I can convert them back to normal rows. Nonetheless, my consolidation table is counting the totals of all data in all data tables. This much I've already accomplished. Now I have one last function and formula I'm working on in order to determine which of the eight data tables record wins, ties, or losses while it simultaneously counts which of the wins, ties, or losses fall within certain categories like elapsed time, and this will be shown on my consolidation table only in the last three rows. Yes, I've gotten the total wins counted, and separately counted the total number of times 20 minutes was the elapsed time used, but so far, just looking at my consolidation table I don't know if the total number of times 20 minutes was used was with a win, tie, or loss. That's what I need to know now. Everything else is already accomplished. So then my consolidation table will show the totals for all data fields in my eight data tables as illustrated in cells B3 and E6. The last three rows of my consolidation table will break this down in a single function and formula with one row for wins, a second for ties, and a third for losses. And each of these respective last three rows will in the same function and formula determine if the win, tie, or loss also is one of the data fields in my eight data tables. How? By the use of columns in my consolidation table. Remember, each of my eight data tables are identical. In the example in my first post I only used one data field, elapsed time (Time in Trade), to illustrate in one column on my consolidation table what I'm trying to accomplish with all of the columns not shown in my consolidation table. Once this is figured out I can adjust it to complete the remainder of the consolidation table. Thank you, t quinn.
    To all reading this and attempting to offer assistance, if for any reason I'm still not explaining myself clearly, please continue to ask me more specific questions. I realize it's hard to communicate this way, and if Apple allowed us to upload the actual spreadsheet it would make this entire forum a better place to communicate. But that's going off topic, so let's simply focus on the matter at hand. Thank you.
    Blessings!

  • Scheme Exercise (Structure and Interpretation book)

    I've been working through the Structure and Interpretation of Computer Programs book and have hit a bit of a problem.  Since I chose to use this book as part of my curriculum, my teacher doesn't actually know much of anything about Lisp or its varients, so I was hoping to get a bit of help.
    The problem is:
    Section 1.2 wrote:Exercise 1.11.  A function f is defined by the rule that f(n) = n if n<3> 3. Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process.
    I have no trouble writing a recursive procedure/recursive process, but I am having trouble writing it iteratively; I'm not familiar enough with Lisp to know how to model this, and I don't know how to do it iteratively with three branching sections.  I'm assuming it'd require some sort of running total and a number of variables to save the state, and I was thinking about possibly trying to work from the bottom up, but I'm not real sure. 
    If anyone can help me with an iterative version, it'd be much appreciated; right now I'm just confused.

    Let's write down some examples of this function:
    f(0) = 0
    f(1) = 1
    f(2) = 2
    f(3) = f(2) + 2*f(1) + 3*f(0)
    f(4) = f(3) + 2*f(2) + 3*f(1)
    f(5) = f(4) + 2*f(3) + 3*f(2)
    If you compute the value of f(5) recursively you do it like this:
    f(5) = f(4) + 2*f(3) + 3*f(2)
    f(4) = f(3) + 2*f(2) + 3*f(1)
    f(3) = f(2) + 2*f(1) + 3*f(0)
    f(2) = 2
    f(1) = 1
    f(0) = 0
    f(3) = 2 + 2*1 + 3*0
    If you do this iteratively you do it the other way around:
    f(0) = 0
    f(1) = 1
    f(2) = 2
    f(3) = f(2) + 2*f(1) + 3*f(0)
    f(4) = f(3) + 2*f(2) + 3*f(1)
    f(5) = f(4) + 2*f(3) + 3*f(2)
    The last three lines have the same structure:
    f(n) = previous + 2*before-previous + 3*before-before-previous
    If you want to compute f(n) you only need the 3 previous values at any time. To compute f(3) you need f(2), f(1) and f(0). Let's give these short names:
    previous = a
    before-previous = b
    before-before-previous = c
    If you want to compute f(3):
    a = f(2) = 2
    b = f(1) = 1
    c = f(0) = 0
    Now we compute f(4):
    a = f(3) = ?
    b = f(2) = 2
    c = f(1) = 1
    For b and c it's easy to define them in terms of previous values a, b and c:
    b = previous-a
    c = previous-b
    Verify that this is correct.
    a is a little tickier because we need the original formula:
    a = previous-a + 2*previous-b + 3*previous-c
    So this is what we have now:
    a = previous-a + 2*previous-b + 3*previous-c
    b = previous-a
    c = previous-b
    Let's rewrite that with arrow notation:
    a -> a + 2*b + 3*c
    b -> a
    c -> b
    These arrows mean that you compute them in parallel; the a in b -> a is still the previous a, and not the new a generated by a -> a + 2*b + c.
    Computing f(5) with this iterative method:
    a -> 2
    b -> 1
    c -> 0
    These are the base-case values because f(n) = n if n <3> 2 + 2*1 + 3*0 = 4
    b -> 2
    c -> 1
    (n = 4)
    a -> 4 + 2*2 + 3*1 = 11
    b -> 4
    c -> 2
    (n = 5)
    a -> 11 + 2*4 + 3*2 = 25
    b -> 11
    c -> 4
    The answer of f(5) is in a: 25.
    The basic structure of the procedure looks like this:
    (define (f n)
    (define (iter counter a b c)
    (if (= counter n)
    c
    (iter (+ counter 1)
    ; new a
    ; new b
    ; new c
    (iter 0 2 1 0))
    The rest is an exercise.
    Don't shoot me if this isn't correct! (I didn't implement the actual procedure ;-))

  • Fields missing in MPD report after change to structure and program

    I have been working on a consistency report for transaction MPD.
    I had created a structure in SE11 for handling the data.  it was all working, but then i had to go and change the name of the fields in the structure.  Now those fields are missing from the report. 
    When i step through the debugger, all the fields are being populated correctly, but these fields are not displayed on screen.  if i change the field names back in the structure and change the code for populating these fields, they appear okay.
    i have created a custom implementation within BAdi MPD_WKB_REPORTING. 
    i have checked the config and it all points to my Z Structure and Z Table Type.  I have logged off and logged back on!  made sure my code is saved and activated...
    any ideas on how i can display these new fields names/values?
    Just for clarity, the field name has changed. not the linked data type.

    thanks for your response, however those notes and program have not done anything to assist my issue.
    i have found the anwser now!
    within the BAdi was a method i had to amend:  IF_EX_MPD_WKB_REPORTING~GET_ALV_PARAMETERS 
    all fixed now!

  • How to access structure in VBScript both Structure and it's only member has the same name

    Hello,
    I VB Script how to access the structure's member if both the structure and the only member has the same name,
    Example,
    Structure name is User and it has only one member called "User" with the Datatype of String.
    When I call using User.User = "Some Text", it is giving me error so I couldn't assign any value to it.
    Kindly help me.
    Nallasivan

    I am using VB Script to Access SAP web Services, the sap web service has a method called user change, there are 3 mandatory parameters username, password and passwordX.
    Here username is string so I can assign value without any problem, password is a type of Bapipwd. Bapipwd is a structure and it has a member called Bapipwd. To access that from VB script I have to use
    Bapipwd.Bapipwd = "Password".
    But when I try to put the statement Bapipwd.Bapipwd = "password" it shows an error message that "Bapipwd doesnt have member called Bapipwd".
    The passwordX also a structure in SAP with the name of Bapipwdx and it has a member "Bapipwd"
    If I user Bapipwdx.Bapipwd="X" it is working fine. Because both the structure and it's member name is different. But Bapipwd.Bapipwd is not working and it gives "Bapipwd doestn't have member Bapipwd"
    I suspect this is due to both the structure and its member has the same name. Kindly help me to access the structure.

  • How can i point to a specific field in DEEP structure and populate it?

    Hello,
    I have declared a internal table as below,
    DATA: BEGIN OF wa_data,
                  vkorg TYPE vkorg
                  vtweg TYPE vtweg
                  spartTYPE spart
                  field_name TYPE CHAR30
                   value TYPE CHAR50
                END OF wa_data
    DATA: ls_data TYPE wa_data,
                lt_data TYPE STANDARD TABLE OF wa_data.
    The lt_data is populated as below,
    VKORG-------VTWEG-------SPART-------FIELD_NAME-------VALUE
    1000-----------10-------------01------------KALKS---------------ZP00 "Pricing procedure
    1000-----------10-------------01------------ZTERM---------------15 days "Payment terms
    1000-----------10-------------01------------MAHNA---------------09 "Dunning
    Fine.
    Now, i have a DEEP DEEP DEEP structure as belowm
    DATA: ls_deep TYPE cmds_ei_extern. "Pls. see this deep structure 'cmds_ei_extern' in SAP DDIC / SE11
    This deep structure is part of Customer master creation. Now, i would like to POPULATE this deep structure from my lt_data itab DYNAMICALLy, i mean, with out mentioning the field names (like, ZTERM, KALKS, MAHNA etc etc), bcz its these i am pulling this lt_data from a custom table, so going further business may also ADD a new record / field like BUSAB (Accouting clerk) with a value of AL (Allen Christi), hence i want to hv dynamic and its less tediuos also bcz,
    We can LOOP lt_data INTO ls_data (for example, the ls_data-field_name = KALKS)
    Now, point the KALKS in the deep deep deep structure and populate it with a value of ls_data-value (= 15 days)
    ENDLLOOP.
    Pls. let me know How can i do this, i guess, we need to use field symbols, pls. let me know the code to achieve my requirement
    Thank you

    Hi,
    Please refer below code.This will populate field kunnr of the deep structure. Once you select the data as per your requirement,you can write similar code to populate rest of the fields in the deep strucure.
    TYPES : BEGIN OF ty_data,
                 kunnr TYPE kunnr,
                 END OF ty_data.
    FIELD-SYMBOLS : <lfs_cmds_ei_header>   TYPE cmds_ei_header,
                    <lfs_cmds_ei_instance>              TYPE cmds_ei_instance,
                    <lfs_kunnr>                                   TYPE kunnr.
    DATA:  lfs_cmds_ei_extern  TYPE cmds_ei_extern,
                 lr_dytable                  TYPE REF TO data,
                 lr_dytable_wa           TYPE REF TO data,
                 lt_data                       TYPE STANDARD TABLE of ty_data ,
                 wa_data                   TYPE ty_data.
      SELECT kunnr
      FROM yalb_kunde
      UP TO 1 ROWS
      INTO TABLE lt_data.
      IF sy-subrc = 0.
        LOOP AT lt_data INTO lwa_data.
          ASSIGN COMPONENT 'HEADER' OF STRUCTURE lfs_cmds_ei_extern TO <lfs_cmds_ei_header>.
          IF sy-subrc = 0.
            ASSIGN COMPONENT 'OBJECT_INSTANCE' OF STRUCTURE <lfs_cmds_ei_header> TO <lfs_cmds_ei_instance>.
            IF sy-subrc = 0.
              ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <lfs_cmds_ei_instance> TO <lfs_kunnr>.
              IF sy-subrc = 0.
                <lfs_kunnr> = lwa_data-kunnr.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Thanks,
    Priya

  • Dynamic Structure and Components Issue

    Hi,
    I have a requirement of creating an inbound idoc program and populating dynamic structures. The program for the dynamic structure creation is as follows: ( I have been referencing Heilmans Blog ): The part for the inbound idoc creation works fine. The data will come in a flat file with Table name and 15 characterstcis. The table name is known at runtime. I need to create the dynamic table, find out the components and then populate the custom table with the dynamically created structures.
    Custom table: 4 components
    Internal table from file: 15 components with value.
    There could be more than one table in the flat file and not all components or char in the flat file is mapped to the table.
    I have been able to code the part where the components in the structure and the file components are in the same order. The problem is if the components in the structure and the file components are not in the same order. I would appreciate some inputs in this issue.
    The part that has to be worked out is:
    IF NOT L_TABNAME IS INITIAL.
        perform get_structure.
        perform create_dynamic_itab.
        perform get_data.
      ENDIF.
    *& Report  /FACTGLB/GTDMI_VARTAB_IDOCS02                               *
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-07-02
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    REPORT  ZGTDMI_VARTAB_IDOCS_DYNAMIC
            NO STANDARD PAGE HEADING
            LINE-SIZE   150
            LINE-COUNT  55
            MESSAGE-ID  zfactglb.
    **Include for Global Data Declaration
    *INCLUDE /FACTGLB/GTDMI_VARTAB_TOP02.
    **Include for Selection Screen
    *INCLUDE /FACTGLB/GTDMI_VARTAB_SEL02.
    **Include for Sub Routines
    *INCLUDE /FACTGLB/GTDMI_VARTAB_FORMS02.
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-07-02
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    TYPE POOLS
    *Type declaration for ALV display
    TYPE-POOLS : slis.
    Include .
    type-pools: col,                                            "#EC *
                icon,                                           "#EC *
                sym,                                            "#EC *
                abap.                                           "#EC *
    Target structure definitions
    tables:
      E1CUVTM,                                                  "#EC *
      E1DATEM,                                                  "#EC *
      E1CUV1M,                                                  "#EC *
      edp21,                                                    "#EC *
      edi_dc40,                                                 "#EC *
      edi_dd40,                                                 "#EC *
      edi_ds40.                                                 "#EC *
    GLOBAL TYPES
    TYPES : BEGIN OF ty_vartab.
            include structure E1CUVTM.
    TYPES:  END OF ty_vartab.
    TYPES : BEGIN OF ty_vartabdate.
            INCLUDE STRUCTURE E1DATEM.
    TYPES : END OF ty_vartabdate.
    *Structure for data retreived
    TYPES : BEGIN OF ty_vardetails.
            INCLUDE STRUCTURE E1CUV1M.
    TYPES : END OF ty_vardetails.
    *Structure for data retreived from table tabinput.
    TYPES : BEGIN OF ty_tabinput,
              lines type string,
            END OF ty_tabinput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_dsninput,                               "#EC *
              LINE(101) type c,
            END OF ty_dsninput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_newinput,                               "#EC *
              LINE(101) type c,
              flag(1) type c,
            END OF ty_newinput.
    *Structure for keeping the values of all the custom tables
    TYPES : BEGIN OF ty_custom_tabs,
              matnr   TYPE matnr,    "Material Number
              werks   TYPE werks_d,  "Plant
              lgort   TYPE lgort_d,  "Storage Location
              qunty   TYPE P DECIMALS 2, "Standard Order Quantity
              det_loc TYPE CHAR6, "Detail Location
              class   TYPE CHAR2,   "Class
              rate    TYPE P DECIMALS 2,    "Rate
            END OF ty_custom_tabs.
    *Type declared for the internal table and work area which will store
    *fields for error log
    TYPES : BEGIN OF ty_error_log,
              matnr TYPE matnr,       "Material Number
              mtart TYPE mtart,       "Material Type
              sel_data TYPE char10,   "No of selectyed data
            END OF ty_error_log.
    *Structure for keeping the output data
    TYPES : BEGIN OF ty_final,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
            END OF ty_final.
    TYPES: begin of TY_CONTENTHD,
              VTNAM(018) type C,
              FLAG(001) type C,
      end of TY_CONTENTHD.
    TYPES: begin of TY_CONTENT,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
              Z_VARCOND TYPE VARCOND.
    TYPES: end of TY_CONTENT.
    TYPES: begin of TY_CONTENTTAB,
              VTNAM(018) type C,
              COMP1(30) TYPE C,
              CHAR1(030) type C,
              COMP2(30) TYPE C,
              CHAR2(030) type C,
              COMP3(30) TYPE C,
              CHAR3(030) type C,
              COMP4(30) TYPE C,
              CHAR4(030) type C,
              COMP5(30) TYPE C,
              CHAR5(030) type C,
              COMP6(30) TYPE C,
              CHAR6(030) type C,
              COMP7(30) TYPE C,
              CHAR7(030) type C,
              COMP8(30) TYPE C,
              CHAR8(030) type C,
              COMP9(30) TYPE C,
              CHAR9(030) type C,
              COMP10(30) TYPE C,
              CHAR10(030) type C,
              COMP11(30) TYPE C,
              CHAR11(030) type C,
              COMP12(30) TYPE C,
              CHAR12(030) type C,
              COMP13(30) TYPE C,
              CHAR13(030) type C,
              COMP14(30) TYPE C,
              CHAR14(030) type C,
              COMP15(30) TYPE C,
              CHAR15(030) type C,
              FLAG(001) type C.
    TYPES: end of TY_CONTENTTAB.
    TYPES: BEGIN OF TY_E1CUVTM,
              MSGFN       TYPE MSGFN,
              VAR_TAB       TYPE APITABL,
              STATUS       TYPE RCUTBST,
              VTGROUP       TYPE RCUTBGR,
              AUTHSTRUC       TYPE RCUTBBE,
              AUTHENTRY       TYPE RCUFNBI,
              FLDELETE       TYPE FLLKENZ,
              DBTABNAME       TYPE TABNAME16,
              DBCONACTIVE TYPE DBCON_ACTI,
              PRESDEC       TYPE VTDCT,
           END OF TY_E1CUVTM.
    TYPES: BEGIN OF TY_E1CUV1M,
              MSGFN     TYPE MSGFN,
              VTLINENO     TYPE VTLINENO,
              VTCHARACT     TYPE ATNAM,
              ATWRT     TYPE ATWRT,
              ATFLV     TYPE ATFLV,
              ATAWE     TYPE MSEHI,
              ATFLB     TYPE ATFLB,
              ATAW1     TYPE MSEHI,
              ATCOD     TYPE ATCOD,
              ATTLV     TYPE ATTLV,
              ATTLB     TYPE ATTLB,
              ATPRZ     TYPE ATPRZ,
              ATINC     TYPE ATINC,
              VTLINENO5     TYPE VTLINENO5,
           END OF TY_E1CUV1M.
    TYPES: BEGIN OF TY_E1DATEM,
              MSGFN       TYPE MSGFN,
              KEY_DATE       TYPE SYDATUM,
              AENNR       TYPE AENNR,
              EFFECTIVITY TYPE      CC_MTEFF,
           END OF TY_E1DATEM.
    TYPES: BEGIN OF ty_vtnam,
             vtint TYPE vtint,  " Internal number of variant table
             vtnam TYPE vtnam,  " Name of variant table
             dbtab_name type tabname16, "Custom table Name
             error  TYPE char1,  " Indicates error in data format
             reas   TYPE char50, " Reason for failure
           END OF ty_vtnam.
    Get data type for characteristic
    TYPES: BEGIN OF ty_cabn,
            atinn  TYPE atinn,       "Internal characteristic
            atnam  TYPE atnam,       "Characteristic Name
            atfor  TYPE atfor,       "Data type of characteristic
            atson  TYPE atson,       "Indicator: Additional Values
            atprt  TYPE atprt,       "Check table
            atprr  TYPE atprr,       "Name of Check Report Program
            atprf  TYPE atprf,       "Function Module for Checking Values
            anzdz  TYPE anzdz,       "Number of Decimal Places
            check  TYPE char1,       "Indicates check required or not
           END OF ty_cabn.
    Get field names of variant table
    TYPES: BEGIN OF ty_cuvtab_fld,
             vtint TYPE vtint,   " Internal number of variant table
             atinn TYPE atinn,   " Internal characteristic
             vtpos TYPE vtpos,   " Item number of characteristic in variant
    *mod-012
            DBFLD type NAME_FELD,
    *mod-012
             exist TYPE char1,   " X Indictaes characteristic is part of fil
           END OF ty_cuvtab_fld.
    Store all data in internal table
    TYPES: BEGIN OF ty_file,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              flag   TYPE char1,
              error  TYPE char50,
           END OF ty_file.
    To check for duplicates
    TYPES: BEGIN OF ty_dupl,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              slnid  TYPE  slnid,
            END OF ty_dupl.
    Get previously loaded characteristic values for internal table (CHAR)
    TYPES: BEGIN OF ty_cuvtab_valc,
            vtint  TYPE  vtint,   " Internal number of variant table
            slnid  TYPE  slnid,   " Key for value combination in variant tab
            atinn  TYPE  atinn,   " Internal characteristic
            valc   TYPE  atwrt,   " Characteristic Value
          END OF ty_cuvtab_valc.
    Get previously loaded characteristic values for internal table (NUM)
    TYPES: BEGIN OF ty_cuvtab_valn,
            vtint  TYPE  vtint,      " Internal number of variant table
            slnid  TYPE  slnid,      " Key for value combination in variant tab
            atinn  TYPE  atinn,      " Internal characteristic
            val_from  TYPE  atflv,   " Internal floating point from
           END OF ty_cuvtab_valn.
    Store column positions of characteristics
    TYPES: BEGIN OF ty_col_pos,
             vtint  TYPE vtint,   " Internal number of variant table
             vtnam  TYPE vtnam,   " Variant table name
             atinn  TYPE atinn,   "Internal characteristic
             atnam  TYPE atnam,   "Characteristic Name
             field  TYPE fieldname,   "Field name
             req    TYPE char1,       " Required or not
             vtpos  TYPE vtpos,       " Item number of characteristics
             DBFLD type NAME_FELD,    " Field Name of Custom table.
           END OF ty_col_pos.
    Store valid values for characteristics
    TYPES: BEGIN OF ty_cawn,
              atinn TYPE atinn,   " Internal characteristic
              atzhl TYPE atzhl,   " Int counter
              atwrt TYPE atwrt,   " Characteristic Value
              atflv TYPE atflv,   " Internal floating point from
              lkenz TYPE lkenz,   " Deletion indicator
          END OF ty_cawn.
    Store error messages for individual lines
    TYPES: BEGIN OF ty_error,
             vtnam  TYPE vtnam,       " Variant table name
             fname  TYPE fieldname,   " Fieldname
             atnam  TYPE atnam,       " Characteristic name
             atwrt  TYPE atwrt,       " Characteristic value
             row    TYPE char5,       " Row id
          END OF ty_error.
    Begin TPR# 4618
    To store unique number for variant
    TYPES: BEGIN OF ty_vnt_ma,
            vtnam     TYPE vtnam,
            unique_no TYPE ZGTDM_UNQN,
            no_chr    TYPE ZGTDM_NO_CHR,
          END OF ty_vnt_ma.
    TYPES: BEGIN OF ty_dbtab,
            vtint     TYPE vtint,
            vtnam     TYPE vtnam,
            DBTAB_NAME TYPE TABNAME16,
          END OF ty_dbtab.
    To find out concatenated number for
    TYPES: BEGIN OF ty_split,
            f1 TYPE char6,
          END OF ty_split.
    TYPES: BEGIN OF ty_charval,
            char TYPE char30,
          END OF ty_charval.
    TYPES: BEGIN OF TY_DATA,
           name TYPE string,
           value(15) type c,
          END OF TY_DATA.
    DATA: I_DATATAB TYPE STANDARD TABLE OF TY_DATA.
    TYPES:
      TUMLS_MESSTYPE type /SAPDMC/LS_MESSTYPE,
      TUMLS_MESSTYPETXT type EDI_TEXT60,
      TUMLS_MESSCODE type EDIPMESCOD.
    TYPES:
      TUMLS_TABNAME TYPE TABNAME,                               "#EC *
      TUMLS_SEGMENT TYPE TABNAME.                               "#EC *
    TYPES:
      TUMLS_PATHFILE TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILENAME TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILETEXT TYPE /SAPDMC/LS_FILETEXT.
    TYPES:
      BEGIN OF type_errorline,
         msgty type SYMSGTY,
         id type SYMSGID,
         msgno type symsgno,
         par1 type symsgv,
         par2 type symsgv,
         par3 type symsgv,
         par4 type symsgv,
      END OF type_errorline.
    TYPES:
      type_errortab TYPE SORTED TABLE
                    OF type_errorline
                    WITH NON-UNIQUE KEY id msgno par1 par2 par3 par4.
    DATA:
        LV_INDEX TYPE SY-INDEX,
        LV_INDEX2 TYPE SYINDEX,
        LV_TABLE1 TYPE REF TO DATA,
        LV_TABLE2 TYPE REF TO DATA,
        LV_TABLE3 TYPE REF TO DATA,
        LV_TABLE4 TYPE REF TO DATA,
        LV_LINE1  TYPE REF TO DATA,
        LV_LINE2  TYPE REF TO DATA,
        LV_LINE3  TYPE REF TO DATA,
        LV_LINE4  TYPE REF TO DATA,
        LV_OFFSET1 TYPE SYTABIX,
        ST_IS_LAYOUT_ALV TYPE SLIS_LAYOUT_ALV,
        L_IT_FCATLOG_ALV TYPE SLIS_T_FIELDCAT_ALV,
        L_IT_FLDCAT TYPE LVC_T_FCAT.
    GLOBAL INTERNAL TABLES
    DATA : i_newinput TYPE STANDARD TABLE OF ty_newinput INITIAL SIZE 0."#EC *
    DATA : i_contentheader1 TYPE STANDARD TABLE OF ty_contenthd INITIAL SIZE 0."#EC *
    DATA : i_contenttab1 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab2 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab3 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab4 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab5 TYPE STANDARD TABLE OF ty_contenttab INITIAL SIZE 0."#EC *
    DATA : i_E1CUV1M TYPE STANDARD TABLE OF E1CUV1M INITIAL SIZE 0."#EC *
    DATA : i_errortab TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    GLOBAL WORK AREAS
    **Internal Table for the structure TY_T001L
    DATA : wa_vartab TYPE ty_vartab.                            "#EC *
    DATA : wa_vartabdate TYPE ty_vartabdate.                    "#EC *
    DATA : wa_vardetails TYPE ty_vardetails.                    "#EC *
    DATA : wa_tabinput TYPE ty_tabinput.                        "#EC *
    DATA : wa_dsninput TYPE ty_dsninput.                        "#EC *
    DATA : wa_newinput TYPE ty_newinput.                        "#EC *
    DATA : wa_gnewinput TYPE ty_newinput.                       "#EC *
    DATA : wa_ginput_data TYPE ty_newinput.                     "#EC *
    DATA : wa_final TYPE ty_final.                              "#EC *
    DATA : wa_content TYPE ty_content.                          "#EC *
    DATA : wa_contenthd TYPE ty_contenthd.                      "#EC *
    DATA : wa_contentheader type ty_contenthd.                  "#EC *
    DATA : wa_contenttab TYPE ty_content.                       "#EC *
    DATA : wa_content1 TYPE ty_content.                         "#EC *
    DATA : wa_contenthd1 TYPE ty_contenthd.                     "#EC *
    DATA : wa_contentheader1 type ty_contenthd.                 "#EC *
    DATA : wa_contenttab1 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab2 TYPE ty_content.                      "#EC *'
    DATA : wa_contenttab3 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab4 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab5 TYPE ty_contentTAB.                   "#EC *
    DATA : wa_E1CUVTM TYPE E1CUVTM.                             "#EC *
    DATA : wa_E1CUV1M TYPE E1CUV1M.                             "#EC *
    DATA : wa_E1DATEM TYPE E1DATEM.                             "#EC *
    DATA : wa_error_tab TYPE solisti1.                          "#EC *
    INTERNAL TABLES AND WORK AREAS FOR BDC
    *Internal Table to store the data to display the error message
    DATA : i_errormsg TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    *Internal Table to store the data to display the error message
    DATA : i_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    DATA : itab_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    **Work area to store the data to display the error message
    DATA : wa_errormsg TYPE solisti1.                           "#EC *
    **Internal table which will store data for the error log
    DATA:i_error_log TYPE STANDARD TABLE OF ty_error_log INITIAL SIZE 0."#EC *
    GLOBAL VARIABLES
    DATA:  G_FILE TYPE string.                                  "#EC *
    DATA : g_ctr_input_recs(5) type c.                          "#EC *
    DATA:  g_ctr_output_recs(5) type p.                         "#EC *
    data : g_msg(100) type c.                                   "#EC *
    data:  g_struct_file TYPE string.                           "#EC *
    data:  g_login type FILEINTERN.                             "#EC *
    data:  g_phyin type string.                                 "#EC *
    DATA:  g_lprnt type RSPOPSHORT.                             "#EC *
    DATA:  g_FNAME1 TYPE STRING.                                "#EC *
    DATA : g_repid TYPE repid,                                  "#EC *
           g_exit(1) TYPE C,                                    "#EC *
           gx_variant  type disvariant.                         "#EC *
    DATA : g_lines    TYPE i .                                  "#EC *
    data : g_save(1) type c.                                    "#EC *
    DATA : g_splid     TYPE rspoid .                            "#EC *
    data:  p_login type FILEINTERN.                             "#EC *
    data:  p_phyin type string.                                 "#EC *
    DATA:
      go_table         TYPE REF TO cl_salv_table,
      go_sdescr        TYPE REF TO cl_abap_structdescr,
      go_tdescr        TYPE REF TO cl_abap_tabledescr,
      gdo_data         TYPE REF TO data,
      gdo_handle       TYPE REF TO data,
      gs_comp          TYPE abap_componentdescr,
      gt_components    TYPE abap_component_tab.
    FIELD-SYMBOLS:
           TYPE table.
    GLOBAL CONSTANTS
    CONSTANTS c_msgar   TYPE rslgarea   VALUE 'F8'.             "#EC *
    CONSTANTS c_msgid   TYPE rslgsubid  VALUE 'E'.              "#EC *
    CONSTANTS c_urgnc   TYPE char04     VALUE 'HIGH'.           "#EC *
    CONSTANTS C_X(1)       TYPE C          VALUE 'X'.           "#EC *
    CONSTANTS C_Y(1)       TYPE C          VALUE 'Y'.           "#EC *
    CONSTANTS C_Z(1)       TYPE C          VALUE 'Z'.           "#EC *
    CONSTANTS C_E(1)       TYPE C          VALUE 'E'.           "#EC *
    CONSTANTS C_SAP(3)     TYPE C          VALUE 'SAP'.         "#EC *
    CONSTANTS C_MOD(3)     TYPE C          VALUE 'MOD'.         "#EC *
    CONSTANTS C_MD1(3)     TYPE C          VALUE 'MD1'.         "#EC *
    CONSTANTS C_MD2(3)     TYPE C          VALUE 'MD2'.         "#EC *
    CONSTANTS C_MD3(3)     TYPE C          VALUE 'MD3'.         "#EC *
    CONSTANTS C_MD4(3)     TYPE C          VALUE 'MD4'.         "#EC *
    CONSTANTS C_MD5(3)     TYPE C          VALUE 'MD5'.         "#EC *
    constants:   c_000001(6)  type c value '000001',            "#EC *
                 c_e1cuv1m(7) type c value 'E1CUV1M',           "#EC *
                 c_02(2)  type c value '02',                    "#EC *
                 c_009(3)   type c value '009',                 "#EC *
                 c_0001(4) type c value '0001'.                 "#EC *
    constants:  c_e1datem(7) type c value 'E1DATEM'.            "#EC *
    constants:  c_e1cuvtm(7) type c value 'E1CUVTM'.            "#EC *
    GLOBAL INTERNAL TABLES FOR ALV DISPLAY
    *Internal tables for ALV Field cat
    DATA :
    i_fieldcat_ov  TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_dtl TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_ov1 TYPE lvc_t_fcat,                             "#EC *
    i_events       TYPE slis_t_event.                           "#EC *
    GLOBAL WORK AREAS FOR ALV DISPLAY
    *Work area for ALV Field layout
    DATA : wa_layout TYPE slis_layout_alv.                      "#EC *
    *Work area for Field Cat. Table
    DATA : wa_fieldcat TYPE slis_fieldcat_alv.                  "#EC *
    GLOBAL VARIABLES FOR ALV DISPLAY
    DATA : g_event  TYPE slis_t_event.                          "#EC *
    DATA : g_top_of_page TYPE slis_t_listheader.                "#EC *
    DATA : g_ok_code     TYPE char4.                            "#EC *
    DATA : g_variant     type disvariant.                       "#EC *
    GLOBAL CONSTANTS FOR ALV DISPLAY
    BAL handling
    data: iv_log_handle type BALLOGHNDL.                        "#EC *
    data: is_log_header type bal_s_log.                         "#EC *
    data: iv_object     type bal_s_log-object    value 'CAPI'.  "#EC *
    data: iv_subobject  type bal_s_log-subobject value 'CAPI_LOG'."#EC *
    data: iv_tcode      type bal_s_log-altcode   value 'SE38'.  "#EC *
    *MOD-005
    RANGES:
        R_MESTYP FOR EDIDC-MESTYP,                              "#EC *
        R_CREDAT FOR EDIDC-CREDAT,                                  "#EC *
        R_CRETIM FOR EDIDC-CRETIM,                              "#EC *
        R_SNDPRT FOR EDIDC-SNDPRT,                              "#EC *
        R_SNDPRN FOR EDIDC-SNDPRN.                              "#EC *
    DATA:
        L_MESSTYPE TYPE TUMLS_MESSTYPE.                         "#EC *
    *MOD-005
    data:        p_sndprn TYPE EDI_SNDPRN,                      "#EC *
                 p_sndprt TYPE EDI_SNDPRT,                      "#EC *
                 p_sndpor TYPE EDI_SNDPOR.                      "#EC *
    data:        p_rcvprn TYPE EDI_RCVPRN,                      "#EC *
                 p_rcvprt TYPE EDI_RCVPRT,                      "#EC *
                 p_rcvpor TYPE EDI_RCVPOR.                      "#EC *
    data:
      init_E1CUVTM type E1CUVTM,                                "#EC *
      prev_E1CUVTM type E1CUVTM,                                "#EC *
      init_E1DATEM type E1DATEM,                                "#EC *
      prev_E1DATEM type E1DATEM,                                "#EC *
      init_E1CUV1M type E1CUV1M,                                "#EC *
      prev_E1CUV1M type E1CUV1M.                                "#EC *
    Source structure definitions
    data:
      begin of LSMW_TAB_CONTENT,                                "#EC *
        VTNAM(018) type C,
        CHAR1(030) type C,
        CHAR2(030) type C,
        CHAR3(030) type C,
        CHAR4(030) type C,
        CHAR5(030) type C,
        CHAR6(030) type C,
        CHAR7(030) type C,
        CHAR8(030) type C,
        CHAR9(030) type C,
        CHAR10(030) type C,
        CHAR11(030) type C,
        CHAR12(030) type C,
        CHAR13(030) type C,
        CHAR14(030) type C,
        CHAR15(030) type C,
        FLAG(001) type C,
      end of LSMW_TAB_CONTENT.
    Counters
    data:
      g_cnt_VAR_TAB  type i,                                    "#EC *
      g_cnt_TAB_CONTENT  type i.                                "#EC *
    Counter ct_xxxxxxxxxx: number of transferred records
    data:
      ct_edi_dc40 type i,                                       "#EC *
      cs_edi_dc40 type i,                                       "#EC *
      ct_E1CUVTM  type i,                                       "#EC *
      cs_E1CUVTM  type i,                                       "#EC *
      ct_E1DATEM  type i,                                       "#EC *
      cs_E1DATEM  type i,                                       "#EC *
      ct_E1CUV1M  type i,                                       "#EC *
      cs_E1CUV1M  type i.                                       "#EC *
    Global data definitions and data declarations
    DATA: wa_cabn TYPE ty_cabn,
          wa_cawn TYPE ty_cawn,
          wa_file TYPE ty_file,
          wa_vtnam TYPE ty_vtnam,
          wa_cuvtab_fld TYPE ty_cuvtab_fld,
          wa_cuvtab_valn TYPE ty_cuvtab_valn,
          wa_cuvtab_valc TYPE ty_cuvtab_valc,
          wa_col_pos     TYPE ty_col_pos,
          wa_error       TYPE ty_error,
          wa_dupl        TYPE ty_dupl,
          wa_dupl_file   TYPE ty_dupl.
    DATA: wa_vnt_ma TYPE ty_vnt_ma,
          wa_split  TYPE ty_split.
    DATA: wa_charval TYPE ty_charval.                           "#EC *
    Internal table
    DATA: i_cabn        TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_temp   TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_atinn  TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_file        TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_file_tmp    TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_vtnam       TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab      TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab_fld  TYPE STANDARD TABLE OF ty_cuvtab_fld,   "#EC *
          i_cuvtab_valn TYPE STANDARD TABLE OF ty_cuvtab_valn,  "#EC *
          i_cuvtab_valc TYPE STANDARD TABLE OF ty_cuvtab_valc,  "#EC *
          i_col_pos     TYPE STANDARD TABLE OF ty_col_pos,      "#EC *
          i_cawn        TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_n      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_c      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_i      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cuv_error   TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_dupl        TYPE STANDARD TABLE OF ty_dupl,         "#EC *
          i_dbtab       TYPE STANDARD TABLE OF ty_dbtab.        "#EC *
    DATA: i_vnt_ma TYPE STANDARD TABLE OF ty_vnt_ma,            "#EC *
          i_split  TYPE STANDARD TABLE OF ty_split.             "#EC *
    DATA: i_dupl_file TYPE STANDARD TABLE OF ty_dupl.           "#EC *
    DATA: i_charval TYPE STANDARD TABLE OF ty_charval.          "#EC *
    Constants
    CONSTANTS: c_char TYPE atfor VALUE 'CHAR',                  "#EC *
               c_date TYPE atfor VALUE 'DATE',                  "#EC *
               c_time TYPE atfor VALUE 'TIME',                  "#EC *
               c_varcond TYPE atnam VALUE 'Z_VARCOND'.          "#EC *
    Field Symbols
    FIELD-SYMBOLS:  TYPE ANY.
    Variables
    DATA: g_raw(500)  TYPE c,                                   "#EC *
          g_invalid   TYPE char1,                               "#EC *
          g_error     TYPE char1,                               "#EC *
          g_message   TYPE char50,                              "#EC *
          g_slnid_c    TYPE slnid,                              "#EC *
          g_slnid_n    TYPE slnid,                              "#EC *
          g_row        TYPE char5.                              "#EC *
    DATA: g_varcond TYPE varcond, "Variant condition "#EC NEEDED
          g_split_var TYPE i.                                   "#EC *
    Types: begin of ty_charname,
             name type atnam,
           end of ty_charname.
    data: wa_charname type ty_charname,                         "#EC *
          i_charname type standard table of ty_charname.        "#EC *
    data: cnt_i type i,                                         "#EC *
          g_tabix type char10.                                  "#EC *
    Types: begin of ty_itab_zedidc40.
            include structure edi_dc40.
    TYPES:       end of ty_itab_zedidc40.
    Types: begin of ty_itab_zedidd40.
            include structure edi_dd40.
    TYPES: end of ty_itab_zedidd40.
    DATA: itab_zedidc40 type standard table of
                      ty_itab_zedidc40 initial size 0.          "#EC *
    DATA: itab_zedidd40 type standard table of
                      ty_itab_zedidd40 initial size 0.          "#EC *
    DATA: wa_itab_zedidc40 type ty_itab_zedidc40.
    DATA: wa_itab_zedidd40 type ty_itab_zedidd40.
    *MOD-009
    data: itab_ze1cuvtm type e1cuvtm,                           "#EC *
          itab_ze1datem type e1datem,                           "#EC *
          itab_ze1cuv1m type e1cuv1m.                           "#EC *
    data: wdocnum(16) type n value 0.                           "#EC *
    data: wsegnum(6)  type n value 0.                           "#EC *
    data: witemno(10) type n value 0.                           "#EC *
    data: witemno_new(10)  type n value 0.                      "#EC *
    data: witemno_gst(10)  type n value 0.                      "#EC *
    data: witemno_qst(10)  type n value 0.                      "#EC *
    TYPES: BEGIN OF ty_input_data1,                             "#EC *
              line(560) type c,
              flag(1) type c,
           END OF ty_input_data1.
    DATA: i_input_data type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: i_input_data1 type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: wa_input_data type ty_input_data1.                    "#EC *
    DATA: g_cnt_input_recs type i.                              "#EC *
    DATA: g_flg_error type c.                                   "#EC *
    DATA: l_lines type i.                                       "#EC *
    DATA: l_lines_varcond type i.                               "#EC *
    DATA: l_lines1 type i.                                      "#EC *
    DATA: l_tabix type i.                                       "#EC *
    DATA: wa_input_data1 type ty_input_data1.                   "#EC *
    DATA: FILE TYPE STRING.
    Fields that are made available to the user:
    DATA:
      g_cnt_records_read TYPE i,                                "#EC *
      g_cnt_records_transferred TYPE i,                         "#EC *
      g_cnt_transactions_read TYPE i,                           "#EC *
      g_cnt_transactions_transferred TYPE i,                    "#EC *
      g_cnt_idocs_package TYPE i.                               "#EC *
    data: v_log_handle type balloghndl.                         "#EC *
    DATA: gt_curr_edi_dc40 TYPE STANDARD TABLE OF edi_dc40 initial size 0."#EC *
    DATA: gt_curr_edi_dd40 TYPE STANDARD TABLE OF edi_dd40 initial size 0."#EC *
    DATA: wa_curr_edi_dc40 TYPE edi_dc40.                       "#EC *
    DATA: wa_curr_edi_dd40 TYPE edi_dd40.                       "#EC *
    internal table for error messages during conversion
    DATA: g_error_tab TYPE type_errortab,                       "#EC *
          wa_errortab TYPE type_errorline.                      "#EC *
    DATA:  g_edidd_segnam type EDI4SEGNAM,                      "#EC *
           g_edidd_hlevel type EDI4HLEVEC.                      "#EC *
    DATA: g_segnum(6) TYPE n.
    DATA: g_objecttype(2) type C.
    DATA: P_FNAME(128) TYPE C VALUE '/usr/sap/trans/vartabheader'. " MODIF ID MD1 OBLIGATORY.
    DATA: P_FNAME1(128) TYPE C VALUE '/usr/sap/trans/vartabcontent'. " MODIF ID MD1 OBLIGATORY.
    DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
          it_fldcat TYPE lvc_t_fcat.
    field-symbols: .
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    data: l_wa_data TYPE TY_CONTENT,
          l_tabname TYPE tabname,
          itab_data TYPE standard table of TY_CONTENT.
    DATA:   l_len_slnid TYPE i,                                 "#EC NEEDED
            l_len_varcond TYPE i,                               "#EC NEEDED
            l_temp_slnid TYPE i,                                "#EC NEEDED
            l_temp_slnc TYPE char5,                             "#EC NEEDED
            l_temp_varcond TYPE varcond,                        "#EC NEEDED
            l_sub_var      TYPE i,                              "#EC NEEDED
            l_val_split TYPE char10.                            "#EC NEEDED
    DATA: l_invalid.                                          "#EC NEEDED
    DECLARATION FOR SELECTION SCREEN
    *selection-screen skip 1.
    *For all the input field entries
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    *Parameter for Input File Name:
    PARAMETERS:   p_inpt   TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File Variant table
    PARAMETERS:   p_inpt1  TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File variant Content
    SELECTION-SCREEN END OF BLOCK bl1.
    IDoc creation
    selection-screen begin of block idocpars
                     with frame title text-006.
    parameters:
       p_trfcpt as checkbox default C_X MODIF ID MD3,
       p_packge(5) type n default 1 MODIF ID MD3.
    selection-screen end of block idocpars.
    SELECTION-SCREEN BEGIN OF BLOCK bl5 WITH FRAME TITLE text-038.
    Radio Buttons :
    parameters:
      rb_idocp RADIOBUTTON GROUP RB3 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD6,
      rb_custt RADIOBUTTON GROUP RB3 MODIF ID MD6.
    SELECTION-SCREEN END OF BLOCK bl5.
    SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-032.
    Radio Buttons :
    parameters:
      rb_apsrv RADIOBUTTON GROUP RB1 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD4,
      rb_convt RADIOBUTTON GROUP RB1 MODIF ID MD4,
      rb_idoc RADIOBUTTON  GROUP RB1 MODIF ID MD4,
      rb_proc RADIOBUTTON  GROUP RB1 MODIF ID MD4.
    SELECTION-SCREEN END OF BLOCK bl3.
    SELECTION-SCREEN BEGIN OF BLOCK bl4 WITH FRAME TITLE text-037.
    Radio Buttons :
    parameters:
      rb_appct RADIOBUTTON GROUP RB2 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD5,
      rb_conct RADIOBUTTON GROUP RB2 MODIF ID MD5,
      rb_cust RADIOBUTTON  GROUP RB2 MODIF ID MD5.
    SELECTION-SCREEN END OF BLOCK bl4.
    INITIALIZATION
    INITIALIZATION.
    Check selection-screen entries *
    *AT SELECTION-SCREEN.
    PERFORM sub_get_physical_file USING p_fpath p_fname.
    PERFORM sub_get_physical_file1 USING p_fpath1 p_fname1.
    AT SELECTION SCREEN
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    PERFORM sub_get_file. " CHANGING p_fname.         "#EC *
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname1.
    PERFORM sub_get_file1. " CHANGING p_fname1.       "#EC *
    AT SELECTI

    Hi,
      I now have a requirement for the following:
    Duplicate VARCOND if I  Use small letters and capital letters. Sequential number also duplicated.
    Here is the code and would appreciate if someone could shed some light on the issue.
    *& Report  ZVARTABDYNFINAL
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-08-25
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    REPORT  ZVARTABDYNFINAL NO STANDARD PAGE HEADING
            LINE-SIZE   150
            LINE-COUNT  55
            MESSAGE-ID  /factglb/gta_custdev.
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-08-25
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    TYPE POOLS
    TYPE POOLS
    TYPE POOLS
    *Type declaration for ALV display
    TYPE-POOLS : slis.
    Include <icon>.
    type-pools: col,                                            "#EC *
                icon,                                           "#EC *
                sym,                                            "#EC *
                abap.                                           "#EC *
    Target structure definitions
    tables:
      E1CUVTM,                                                  "#EC *
      E1DATEM,                                                  "#EC *
      E1CUV1M,                                                  "#EC *
      edp21,                                                    "#EC *
      edi_dc40,                                                 "#EC *
      edi_dd40,                                                 "#EC *
      edi_ds40.                                                 "#EC *
    GLOBAL TYPES
    TYPES : BEGIN OF ty_vartab.
            include structure E1CUVTM.
    TYPES:  END OF ty_vartab.
    TYPES : BEGIN OF ty_vartabdate.
            INCLUDE STRUCTURE E1DATEM.
    TYPES : END OF ty_vartabdate.
    *Structure for data retreived
    TYPES : BEGIN OF ty_vardetails.
            INCLUDE STRUCTURE E1CUV1M.
    TYPES : END OF ty_vardetails.
    *Structure for data retreived from table tabinput.
    TYPES : BEGIN OF ty_tabinput,
              lines type string,
            END OF ty_tabinput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_dsninput,                               "#EC *
              LINE(101) type c,
            END OF ty_dsninput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_newinput,                               "#EC *
              LINE(101) type c,
              flag(1) type c,
            END OF ty_newinput.
    *Structure for keeping the values of all the custom tables
    TYPES : BEGIN OF ty_custom_tabs,
              matnr   TYPE matnr,    "Material Number
              werks   TYPE werks_d,  "Plant
              lgort   TYPE lgort_d,  "Storage Location
              qunty   TYPE P DECIMALS 2, "Standard Order Quantity
              det_loc TYPE CHAR6, "Detail Location
              class   TYPE CHAR2,   "Class
              rate    TYPE P DECIMALS 2,    "Rate
            END OF ty_custom_tabs.
    *Type declared for the internal table and work area which will store
    *fields for error log
    TYPES : BEGIN OF ty_error_log,
              matnr TYPE matnr,       "Material Number
              mtart TYPE mtart,       "Material Type
              sel_data TYPE char10,   "No of selectyed data
            END OF ty_error_log.
    *Structure for keeping the output data
    TYPES : BEGIN OF ty_final,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
            END OF ty_final.
    TYPES: begin of TY_CONTENTHD,
              VTNAM(018) type C,
              FLAG(001) type C,
      end of TY_CONTENTHD.
    TYPES: begin of TY_CONTENT,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
              Z_VARCOND type VARCOND.
    TYPES: end of TY_CONTENT.
    TYPES: begin of TY_CONTENTTAB,
              VTNAM(018) type C,
              COMP1(30) TYPE C,
              CHAR1(030) type C,
              COMP2(30) TYPE C,
              CHAR2(030) type C,
              COMP3(30) TYPE C,
              CHAR3(030) type C,
              COMP4(30) TYPE C,
              CHAR4(030) type C,
              COMP5(30) TYPE C,
              CHAR5(030) type C,
              COMP6(30) TYPE C,
              CHAR6(030) type C,
              COMP7(30) TYPE C,
              CHAR7(030) type C,
              COMP8(30) TYPE C,
              CHAR8(030) type C,
              COMP9(30) TYPE C,
              CHAR9(030) type C,
              COMP10(30) TYPE C,
              CHAR10(030) type C,
              COMP11(30) TYPE C,
              CHAR11(030) type C,
              COMP12(30) TYPE C,
              CHAR12(030) type C,
              COMP13(30) TYPE C,
              CHAR13(030) type C,
              COMP14(30) TYPE C,
              CHAR14(030) type C,
              COMP15(30) TYPE C,
              CHAR15(030) type C,
              FLAG(001) type C.
    TYPES: end of TY_CONTENTTAB.
    TYPES: BEGIN OF TY_E1CUVTM,
              MSGFN       TYPE MSGFN,
              VAR_TAB       TYPE APITABL,
              STATUS       TYPE RCUTBST,
              VTGROUP       TYPE RCUTBGR,
              AUTHSTRUC       TYPE RCUTBBE,
              AUTHENTRY       TYPE RCUFNBI,
              FLDELETE       TYPE FLLKENZ,
              DBTABNAME       TYPE TABNAME16,
              DBCONACTIVE TYPE DBCON_ACTI,
              PRESDEC       TYPE VTDCT,
           END OF TY_E1CUVTM.
    TYPES: BEGIN OF TY_E1CUV1M,
              MSGFN     TYPE MSGFN,
              VTLINENO     TYPE VTLINENO,
              VTCHARACT     TYPE ATNAM,
              ATWRT     TYPE ATWRT,
              ATFLV     TYPE ATFLV,
              ATAWE     TYPE MSEHI,
              ATFLB     TYPE ATFLB,
              ATAW1     TYPE MSEHI,
              ATCOD     TYPE ATCOD,
              ATTLV     TYPE ATTLV,
              ATTLB     TYPE ATTLB,
              ATPRZ     TYPE ATPRZ,
              ATINC     TYPE ATINC,
              VTLINENO5     TYPE VTLINENO5,
           END OF TY_E1CUV1M.
    TYPES: BEGIN OF TY_E1DATEM,
              MSGFN       TYPE MSGFN,
              KEY_DATE       TYPE SYDATUM,
              AENNR       TYPE AENNR,
              EFFECTIVITY TYPE      CC_MTEFF,
           END OF TY_E1DATEM.
    TYPES: BEGIN OF ty_vtnam,
             vtint TYPE vtint,  " Internal number of variant table
             vtnam TYPE vtnam,  " Name of variant table
             dbtab_name type tabname16, "Custom table Name
             error  TYPE char1,  " Indicates error in data format
             reas   TYPE char50, " Reason for failure
           END OF ty_vtnam.
    Get data type for characteristic
    TYPES: BEGIN OF ty_cabn,
            atinn  TYPE atinn,       "Internal characteristic
            atnam  TYPE atnam,       "Characteristic Name
            atfor  TYPE atfor,       "Data type of characteristic
            atson  TYPE atson,       "Indicator: Additional Values
            atprt  TYPE atprt,       "Check table
            atprr  TYPE atprr,       "Name of Check Report Program
            atprf  TYPE atprf,       "Function Module for Checking Values
            anzdz  TYPE anzdz,       "Number of Decimal Places
            check  TYPE char1,       "Indicates check required or not
           END OF ty_cabn.
    Get field names of variant table
    TYPES: BEGIN OF ty_cuvtab_fld,
             vtint TYPE vtint,   " Internal number of variant table
             atinn TYPE atinn,   " Internal characteristic
             vtpos TYPE vtpos,   " Item number of characteristic in variant
    *mod-012
             DBFLD type NAME_FELD,
    *mod-012
             exist TYPE char1,   " X Indictaes characteristic is part of fil
           END OF ty_cuvtab_fld.
    Store all data in internal table
    TYPES: BEGIN OF ty_file,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              flag   TYPE char1,
              error  TYPE char50,
           END OF ty_file.
    To check for duplicates
    TYPES: BEGIN OF ty_dupl,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              slnid  TYPE  slnid,
            END OF ty_dupl.
    Get previously loaded characteristic values for internal table (CHAR)
    TYPES: BEGIN OF ty_cuvtab_valc,
            vtint  TYPE  vtint,   " Internal number of variant table
            slnid  TYPE  slnid,   " Key for value combination in variant tab
            atinn  TYPE  atinn,   " Internal characteristic
            valc   TYPE  atwrt,   " Characteristic Value
          END OF ty_cuvtab_valc.
    Get previously loaded characteristic values for internal table (NUM)
    TYPES: BEGIN OF ty_cuvtab_valn,
            vtint  TYPE  vtint,      " Internal number of variant table
            slnid  TYPE  slnid,      " Key for value combination in variant tab
            atinn  TYPE  atinn,      " Internal characteristic
            val_from  TYPE  atflv,   " Internal floating point from
           END OF ty_cuvtab_valn.
    Store column positions of characteristics
    TYPES: BEGIN OF ty_col_pos,
             vtint  TYPE vtint,   " Internal number of variant table
             vtnam  TYPE vtnam,   " Variant table name
             atinn  TYPE atinn,   "Internal characteristic
             atnam  TYPE atnam,   "Characteristic Name
             field  TYPE fieldname,   "Field name
             req    TYPE char1,       " Required or not
             vtpos  TYPE vtpos,       " Item number of characteristics
           END OF ty_col_pos.
    Store valid values for characteristics
    TYPES: BEGIN OF ty_cawn,
              atinn TYPE atinn,   " Internal characteristic
              atzhl TYPE atzhl,   " Int counter
              atwrt TYPE atwrt,   " Characteristic Value
              atflv TYPE atflv,   " Internal floating point from
              lkenz TYPE lkenz,   " Deletion indicator
          END OF ty_cawn.
    Store error messages for individual lines
    TYPES: BEGIN OF ty_error,
             vtnam  TYPE vtnam,       " Variant table name
             fname  TYPE fieldname,   " Fieldname
             atnam  TYPE atnam,       " Characteristic name
             atwrt  TYPE atwrt,       " Characteristic value
             row    TYPE char5,       " Row id
          END OF ty_error.
    Begin TPR# 4618
    To store unique number for variant
    TYPES: BEGIN OF ty_vnt_ma,
            vtnam     TYPE vtnam,
            unique_no TYPE ZGTDM_UNQN,
            no_chr    TYPE ZGTDM_NO_CHR,
          END OF ty_vnt_ma.
    TYPES: BEGIN OF ty_dbtab,
            vtint     TYPE vtint,
            vtnam     TYPE vtnam,
            DBTAB_NAME TYPE TABNAME16,
          END OF ty_dbtab.
    To find out concatenated number for
    TYPES: BEGIN OF ty_split,
            f1 TYPE char6,
          END OF ty_split.
    TYPES: BEGIN OF ty_charval,
            char TYPE char30,
          END OF ty_charval.
    TYPES: BEGIN OF TY_DATA,
           name TYPE string,
           value(15) type c,
          END OF TY_DATA.
    DATA: I_DATATAB TYPE STANDARD TABLE OF TY_DATA. "#EC NEEDED
    TYPES:
      TUMLS_MESSTYPE type /SAPDMC/LS_MESSTYPE,
      TUMLS_MESSTYPETXT type EDI_TEXT60,
      TUMLS_MESSCODE type EDIPMESCOD.
    TYPES:
      TUMLS_TABNAME TYPE TABNAME,                               "#EC *
      TUMLS_SEGMENT TYPE TABNAME.                               "#EC *
    TYPES:
      TUMLS_PATHFILE TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILENAME TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILETEXT TYPE /SAPDMC/LS_FILETEXT.
    TYPES:
      BEGIN OF type_errorline,
         msgty type SYMSGTY,
         id type SYMSGID,
         msgno type symsgno,
         par1 type symsgv,
         par2 type symsgv,
         par3 type symsgv,
         par4 type symsgv,
      END OF type_errorline.
    TYPES:
      type_errortab TYPE SORTED TABLE
                    OF type_errorline
                    WITH NON-UNIQUE KEY id msgno par1 par2 par3 par4.
    DATA:
         LV_LINE2  TYPE REF TO DATA.
    GLOBAL INTERNAL TABLES
    DATA : i_newinput TYPE STANDARD TABLE OF ty_newinput INITIAL SIZE 0."#EC *
    DATA : i_contentheader1 TYPE STANDARD TABLE OF ty_contenthd INITIAL SIZE 0."#EC *
    DATA : i_contenttab1 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab2 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab3 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab4 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab5 TYPE STANDARD TABLE OF ty_contenttab INITIAL SIZE 0."#EC *
    DATA : i_E1CUV1M TYPE STANDARD TABLE OF E1CUV1M INITIAL SIZE 0."#EC *
    DATA : i_errortab TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    GLOBAL WORK AREAS
    **Internal Table for the structure TY_T001L
    DATA : wa_vartab TYPE ty_vartab.                            "#EC *
    DATA : wa_vartabdate TYPE ty_vartabdate.                    "#EC *
    DATA : wa_vardetails TYPE ty_vardetails.                    "#EC *
    DATA : wa_tabinput TYPE ty_tabinput.                        "#EC *
    DATA : wa_dsninput TYPE ty_dsninput.                        "#EC *
    DATA : wa_newinput TYPE ty_newinput.                        "#EC *
    DATA : wa_gnewinput TYPE ty_newinput.                       "#EC *
    DATA : wa_ginput_data TYPE ty_newinput.                     "#EC *
    DATA : wa_final TYPE ty_final.                              "#EC *
    DATA : wa_content TYPE ty_content.                          "#EC *
    DATA : wa_contenthd TYPE ty_contenthd.                      "#EC *
    DATA : wa_contentheader type ty_contenthd.                  "#EC *
    DATA : wa_contenttab TYPE ty_content.                       "#EC *
    DATA : wa_content1 TYPE ty_content.                         "#EC *
    DATA : wa_contenthd1 TYPE ty_contenthd.                     "#EC *
    DATA : wa_contentheader1 type ty_contenthd.                 "#EC *
    DATA : wa_contenttab1 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab2 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab3 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab4 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab5 TYPE ty_contentTAB.                   "#EC *
    DATA : wa_E1CUVTM TYPE E1CUVTM.                             "#EC *
    DATA : wa_E1CUV1M TYPE E1CUV1M.                             "#EC *
    DATA : wa_E1DATEM TYPE E1DATEM.                             "#EC *
    DATA : wa_error_tab TYPE solisti1.                          "#EC *
    INTERNAL TABLES AND WORK AREAS FOR BDC
    *Internal Table to store the data to display the error message
    DATA : i_errormsg TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    *Internal Table to store the data to display the error message
    DATA : i_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    DATA : itab_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    **Work area to store the data to display the error message
    DATA : wa_errormsg TYPE solisti1.                           "#EC *
    **Internal table which will store data for the error log
    DATA:i_error_log TYPE STANDARD TABLE OF ty_error_log INITIAL SIZE 0."#EC *
    GLOBAL VARIABLES
    DATA:  G_FILE TYPE string.                                  "#EC *
    DATA : g_ctr_input_recs(5) type c.                          "#EC *
    DATA:  g_ctr_output_recs(5) type p.                         "#EC *
    data : g_msg(100) type c.                                   "#EC *
    data:  g_struct_file TYPE string.                           "#EC *
    data:  g_login type FILEINTERN.                             "#EC *
    data:  g_phyin type string.                                 "#EC *
    DATA:  g_lprnt type RSPOPSHORT.                             "#EC *
    DATA:  g_FNAME1 TYPE STRING.                                "#EC *
    DATA : g_repid TYPE repid,                                  "#EC *
           g_exit(1) TYPE C,                                    "#EC *
           gx_variant  type disvariant.                         "#EC *
    DATA : g_lines    TYPE i .                                  "#EC *
    data : g_save(1) type c.                                    "#EC *
    DATA : g_splid     TYPE rspoid .                            "#EC *
    data:  p_login type FILEINTERN.                             "#EC *
    data:  p_phyin type string.                                 "#EC *
    GLOBAL CONSTANTS
    CONSTANTS c_msgar   TYPE rslgarea   VALUE 'F8'.             "#EC *
    CONSTANTS c_msgid   TYPE rslgsubid  VALUE 'E'.              "#EC *
    CONSTANTS c_urgnc   TYPE char04     VALUE 'HIGH'.           "#EC *
    CONSTANTS C_X(1)       TYPE C          VALUE 'X'.           "#EC *
    CONSTANTS C_Y(1)       TYPE C          VALUE 'Y'.           "#EC *
    CONSTANTS C_Z(1)       TYPE C          VALUE 'Z'.           "#EC *
    CONSTANTS C_E(1)       TYPE C          VALUE 'E'.           "#EC *
    CONSTANTS C_SAP(3)     TYPE C          VALUE 'SAP'.         "#EC *
    CONSTANTS C_MOD(3)     TYPE C          VALUE 'MOD'.         "#EC *
    CONSTANTS C_MD1(3)     TYPE C          VALUE 'MD1'.         "#EC *
    CONSTANTS C_MD2(3)     TYPE C          VALUE 'MD2'.         "#EC *
    CONSTANTS C_MD3(3)     TYPE C          VALUE 'MD3'.         "#EC *
    CONSTANTS C_MD4(3)     TYPE C          VALUE 'MD4'.         "#EC *
    CONSTANTS C_MD5(3)     TYPE C          VALUE 'MD5'.         "#EC *
    constants:   c_000001(6)  type c value '000001',            "#EC *
                 c_e1cuv1m(7) type c value 'E1CUV1M',           "#EC *
                 c_02(2)  type c value '02',                    "#EC *
                 c_009(3)   type c value '009',                 "#EC *
                 c_0001(4) type c value '0001'.                 "#EC *
    constants:  c_e1datem(7) type c value 'E1DATEM'.            "#EC *
    constants:  c_e1cuvtm(7) type c value 'E1CUVTM'.            "#EC *
    GLOBAL INTERNAL TABLES FOR ALV DISPLAY
    *Internal tables for ALV Field cat
    DATA :
    i_fieldcat_ov  TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_dtl TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_ov1 TYPE lvc_t_fcat,                             "#EC *
    i_events       TYPE slis_t_event.                           "#EC *
    GLOBAL WORK AREAS FOR ALV DISPLAY
    *Work area for ALV Field layout
    DATA : wa_layout TYPE slis_layout_alv.                      "#EC *
    *Work area for Field Cat. Table
    DATA : wa_fieldcat TYPE slis_fieldcat_alv.                  "#EC *
    GLOBAL VARIABLES FOR ALV DISPLAY
    DATA : g_event  TYPE slis_t_event.                          "#EC *
    DATA : g_top_of_page TYPE slis_t_listheader.                "#EC *
    DATA : g_ok_code     TYPE char4.                            "#EC *
    DATA : g_variant     type disvariant.                       "#EC *
    GLOBAL CONSTANTS FOR ALV DISPLAY
    BAL handling
    data: iv_log_handle type BALLOGHNDL.                        "#EC *
    data: is_log_header type bal_s_log.                         "#EC *
    data: iv_object     type bal_s_log-object    value 'CAPI'.  "#EC *
    data: iv_subobject  type bal_s_log-subobject value 'CAPI_LOG'."#EC *
    data: iv_tcode      type bal_s_log-altcode   value 'SE38'.  "#EC *
    *MOD-005
    RANGES:
        R_MESTYP FOR EDIDC-MESTYP,                              "#EC *
        R_CREDAT FOR EDIDC-CREDAT,                                  "#EC *
        R_CRETIM FOR EDIDC-CRETIM,                              "#EC *
        R_SNDPRT FOR EDIDC-SNDPRT,                              "#EC *
        R_SNDPRN FOR EDIDC-SNDPRN.                              "#EC *
    DATA:
        L_MESSTYPE TYPE TUMLS_MESSTYPE.                         "#EC *
    *MOD-005
    data:        p_sndprn TYPE EDI_SNDPRN,                      "#EC *
                 p_sndprt TYPE EDI_SNDPRT,                      "#EC *
                 p_sndpor TYPE EDI_SNDPOR.                      "#EC *
    data:        p_rcvprn TYPE EDI_RCVPRN,                      "#EC *
                 p_rcvprt TYPE EDI_RCVPRT,                      "#EC *
                 p_rcvpor TYPE EDI_RCVPOR.                      "#EC *
    data:
      init_E1CUVTM type E1CUVTM,                                "#EC *
      prev_E1CUVTM type E1CUVTM,                                "#EC *
      init_E1DATEM type E1DATEM,                                "#EC *
      prev_E1DATEM type E1DATEM,                                "#EC *
      init_E1CUV1M type E1CUV1M,                                "#EC *
      prev_E1CUV1M type E1CUV1M.                                "#EC *
    Source structure definitions
    data:
      begin of LSMW_TAB_CONTENT,                                "#EC *
        VTNAM(018) type C,
        CHAR1(030) type C,
        CHAR2(030) type C,
        CHAR3(030) type C,
        CHAR4(030) type C,
        CHAR5(030) type C,
        CHAR6(030) type C,
        CHAR7(030) type C,
        CHAR8(030) type C,
        CHAR9(030) type C,
        CHAR10(030) type C,
        CHAR11(030) type C,
        CHAR12(030) type C,
        CHAR13(030) type C,
        CHAR14(030) type C,
        CHAR15(030) type C,
        FLAG(001) type C,
      end of LSMW_TAB_CONTENT.
    Counters
    data:
      g_cnt_VAR_TAB  type i,                                    "#EC *
      g_cnt_TAB_CONTENT  type i.                                "#EC *
    Counter ct_xxxxxxxxxx: number of transferred records
    data:
      ct_edi_dc40 type i,                                       "#EC *
      cs_edi_dc40 type i,                                       "#EC *
      ct_E1CUVTM  type i,                                       "#EC *
      cs_E1CUVTM  type i,                                       "#EC *
      ct_E1DATEM  type i,                                       "#EC *
      cs_E1DATEM  type i,                                       "#EC *
      ct_E1CUV1M  type i,                                       "#EC *
      cs_E1CUV1M  type i.                                       "#EC *
    Global data definitions and data declarations
    DATA: wa_cabn TYPE ty_cabn,
          wa_cawn TYPE ty_cawn,
          wa_file TYPE ty_file,
          wa_vtnam TYPE ty_vtnam,
          wa_cuvtab_fld TYPE ty_cuvtab_fld,
          wa_cuvtab_valn TYPE ty_cuvtab_valn,
          wa_cuvtab_valc TYPE ty_cuvtab_valc,
          wa_col_pos     TYPE ty_col_pos,
          wa_error       TYPE ty_error,
          wa_dupl        TYPE ty_dupl,
          wa_dupl_file   TYPE ty_dupl.
    DATA: wa_vnt_ma TYPE ty_vnt_ma,
          wa_split  TYPE ty_split.
    DATA: wa_charval TYPE ty_charval.                           "#EC *
    Internal table
    DATA: i_cabn        TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_temp   TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_atinn  TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_file        TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_file_tmp    TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_vtnam       TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab      TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab_fld  TYPE STANDARD TABLE OF ty_cuvtab_fld,   "#EC *
          i_cuvtab_valn TYPE STANDARD TABLE OF ty_cuvtab_valn,  "#EC *
          i_cuvtab_valc TYPE STANDARD TABLE OF ty_cuvtab_valc,  "#EC *
          i_col_pos     TYPE STANDARD TABLE OF ty_col_pos,      "#EC *
          i_cawn        TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_n      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_c      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_i      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cuv_error   TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_dupl        TYPE STANDARD TABLE OF ty_dupl,         "#EC *
          i_dbtab       TYPE STANDARD TABLE OF ty_dbtab.        "#EC *
    DATA: i_vnt_ma TYPE STANDARD TABLE OF ty_vnt_ma,            "#EC *
          i_split  TYPE STANDARD TABLE OF ty_split.             "#EC *
    DATA: i_dupl_file TYPE STANDARD TABLE OF ty_dupl.           "#EC *
    DATA: i_charval TYPE STANDARD TABLE OF ty_charval.          "#EC *
    Constants
    CONSTANTS: c_char TYPE atfor VALUE 'CHAR',                  "#EC *
               c_date TYPE atfor VALUE 'DATE',                  "#EC *
               c_time TYPE atfor VALUE 'TIME',                  "#EC *
               c_varcond TYPE atnam VALUE 'Z_VARCOND'.          "#EC *
    Field Symbols
    FIELD-SYMBOLS: <fs_vtnam>      TYPE ty_vtnam,               "#EC *
                   <fs_cabn>       TYPE ty_cabn,                "#EC *
                   <fs_cuvtab_fld> TYPE ty_cuvtab_fld,          "#EC *
                   <fs_dupl>       TYPE ty_dupl.                "#EC *
    FIELD-SYMBOLS: <FS_DYN_WA> TYPE ANY.
    Variables
    DATA: g_raw(500)  TYPE c,                                   "#EC *
          g_invalid   TYPE char1,                               "#EC *
          g_error     TYPE char1,                               "#EC *
          g_message   TYPE char50,                              "#EC *
          g_slnid_c    TYPE slnid,                              "#EC *
          g_slnid_n    TYPE slnid,                              "#EC *
          g_row        TYPE char5.                              "#EC *
    DATA: g_varcond TYPE varcond, "Variant condition "#EC NEEDED
          g_split_var TYPE i,                                  "#EC *
          g_split_var1 type i.                                 "#EC *
    Types: begin of ty_charname,
             name type atnam,
           end of ty_charname.
    data: wa_charname type ty_charname,                         "#EC *
          i_charname type standard table of ty_charname.        "#EC *
    data: cnt_i type i,                                         "#EC *
          g_tabix type char10.                                  "#EC *
    Types: begin of ty_itab_zedidc40.
            include structure edi_dc40.
    TYPES:       end of ty_itab_zedidc40.
    Types: begin of ty_itab_zedidd40.
            include structure edi_dd40.
    TYPES: end of ty_itab_zedidd40.
    DATA: itab_zedidc40 type standard table of
                      ty_itab_zedidc40 initial size 0.          "#EC *
    DATA: itab_zedidd40 type standard table of
                      ty_itab_zedidd40 initial size 0.          "#EC *
    DATA: wa_itab_zedidc40 type ty_itab_zedidc40.               "#EC NEEDED
    DATA: wa_itab_zedidd40 type ty_itab_zedidd40.
    *MOD-009
    data: itab_ze1cuvtm type e1cuvtm,                           "#EC *
          itab_ze1datem type e1datem,                           "#EC *
          itab_ze1cuv1m type e1cuv1m.                           "#EC *
    data: wdocnum(16) type n value 0.                           "#EC *
    data: wsegnum(6)  type n value 0.                           "#EC *
    data: witemno(10) type n value 0.                           "#EC *
    data: witemno_new(10)  type n value 0.                      "#EC *
    data: witemno_gst(10)  type n value 0.                      "#EC *
    data: witemno_qst(10)  type n value 0.                      "#EC *
    TYPES: BEGIN OF ty_input_data1,                             "#EC *
              line(560) type c,
              flag(1) type c,
           END OF ty_input_data1.
    DATA: i_input_data type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: i_input_data1 type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: wa_input_data type ty_input_data1.                    "#EC *
    DATA: g_cnt_input_recs type i.                              "#EC *
    DATA: g_flg_error type c.                                   "#EC *
    DATA: l_lines type i.                                       "#EC *
    DATA: l_lines1 type i.                                      "#EC *
    DATA: l_tabix type i.                                       "#EC *
    DATA: wa_input_data1 type ty_input_data1.                   "#EC *
    DATA: FILE TYPE STRING.
    Fields that are made available to the user:
    DATA:
      g_cnt_records_read TYPE i,                                "#EC *
      g_cnt_records_transferred TYPE i,                         "#EC *
      g_cnt_transactions_read TYPE i,                           "#EC *
      g_cnt_transactions_transferred TYPE i,                    "#EC *
      g_cnt_idocs_package TYPE i.                               "#EC *
    data: v_log_handle type balloghndl.                         "#EC *
    DATA: gt_curr_edi_dc40 TYPE STANDARD TABLE OF edi_dc40 initial size 0."#EC *
    DATA: gt_curr_edi_dd40 TYPE STANDARD TABLE OF edi_dd40 initial size 0."#EC *
    DATA: wa_curr_edi_dc40 TYPE edi_dc40.                       "#EC *
    DATA: wa_curr_edi_dd40 TYPE edi_dd40.                       "#EC *
    internal table for error messages during conversion
    DATA: g_error_tab TYPE type_errortab,                       "#EC *
          wa_errortab TYPE type_errorline.                      "#EC *
    DATA:  g_edidd_segnam type EDI4SEGNAM,                      "#EC *
           g_edidd_hlevel type EDI4HLEVEC.                      "#EC *
    DATA: g_segnum(6) TYPE n.
    DATA: g_objecttype(2) type C.
    DATA: P_FNAME(128) TYPE C VALUE '/usr/sap/trans/vartabheader'. " MODIF ID MD1 OBLIGATORY.
    DATA: P_FNAME1(128) TYPE C VALUE '/usr/sap/trans/vartabcontent'. " MODIF ID MD1 OBLIGATORY.
    field-symbols: <dyn_table> type standard table,
                   <dyn_table1> type standard table,
                   <dyn_wa>,
                   <dyn_wa1> TYPE ANY.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    data: l_tabname TYPE tabname.
    DATA: l_len_slnid TYPE i,                                 "#EC NEEDED
            l_len_varcond TYPE i,                               "#EC NEEDED
            l_temp_slnid TYPE i,                                "#EC NEEDED
            l_temp_slnc TYPE char5,                             "#EC NEEDED
            l_temp_varcond TYPE varcond,                        "#EC NEEDED
            l_sub_var      TYPE i,                              "#EC NEEDED
            l_val_split TYPE char10.                            "#EC NEEDED
    DATA: l_invalid.                                          "#EC NEEDED
    *Include for Global Data Declaration
    *INCLUDE ZGTDMI_VARTAB_TOPDYN.
    *INCLUDE /FACTGLB/GTDMI_VARTAB_TOP02.
    *Include for Selection Screen
    *INCLUDE ZGTDMI_VARTAB_SELDYN.
    *INCLUDE /FACTGLB/GTDMI_VARTAB_SEL02.
    *Include for Sub Routines
    *INCLUDE ZGTDMI_VARTAB_FORMSDYN.
    *INCLUDE /FACTGLB/GTDMI_VARTAB_FORMS02.
    *&  Include           /FACTGLB/GTDMI_VARTAB_SEL02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_SEL
    *&  Include           /FACTGLB/GTDMI_VARTAB_SEL
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-08-25
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    DECLARATION FOR SELECTION SCREEN
    *selection-screen skip 1.
    *For all the input field entries
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    *Parameter for Input File Name:
    PARAMETERS:   p_inpt   TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File Variant table
    PARAMETERS:   p_inpt1  TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File variant Content
    SELECTION-SCREEN END OF BLOCK bl1.
    IDoc creation
    selection-screen begin of block idocpars
                     with frame title text-006.
    parameters:
       p_trfcpt as checkbox default C_X MODIF ID MD3,
       p_packge(5) type n default 1 MODIF ID MD3.
    selection-screen end of block idocpars.
    SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-032.
    Radio Buttons :
    parameters:
      rb_apsrv RADIOBUTTON GROUP RB1 DEFAULT 'X' USER-COMMAND UCOM,
      rb_convt RADIOBUTTON GROUP RB1,
      rb_idoc RADIOBUTTON GROUP RB1.
    rb_proc RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF BLOCK bl3.
    INITIALIZATION
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INPT.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC        = C_X
        CHANGING
          FILE_NAME     = P_INPT
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC <> 0.
        MESSAGE e241.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INPT1.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC        = C_X
        CHANGING
          FILE_NAME     = P_INPT1
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
     

  • Need urgent help!!!! (combine prompt and formula)

    Hi,
    I am using Oracle Business Intelligence 10.1.3.3.2, and creating some reports from answers. I desperately need to combine
    prompt and formula on some column.
    I need to use prompt in my formula on some column.
    Need urgent help !

    You can use the presentation variables to pass the value of the prompt into the report or any column formula.
    In the dashboard prompt you see an option called "Set Variable" where and you need to give a name to the variable.(Say Var_value)
    Now the value of the variable can be simply referenced using the syntax @{var_name}{10}. Here '10' being the defualt value which is optional you can simply reference using @{var_name} and you have the value of the prompts passed.
    Hope it works
    Thanks
    Prash

  • Issues with Bex query structures and Crystal Reports/Webi

    Hi experts,
    I'm having an issue with Bex Query structures and nulls. I've built a Crystal Report against a Bex query that uses a Bex Query structure. The structure looks like the following
    Budget $
    Budget %
    Actual $
    Actual %
    Budget YTD
    etc
    if I drag the structure into the Crystal Report detail section with a key figure it displays like this
    Budget $     <null>
    Budget %     <null>
    Actual $     300
    Actual %     85
    Budget YTD     250
    the null values are displayed (and this is what is required). However if I filter using a Record selection or group on a profit centre then the nulls along with the associated structure component are not displayed.
    Actual $     300
    Actual %     85
    Budget YTD     250
    Webi is also behaving similarly. Can anyone explain why the above is happening and suggest a solution either on the Bex side of things or on the Crystal Reports side of things? I'm confused as to why nulls are displayed in the first example and not the second.
    Business Objects Edge 3.1 SP2
    SAP Int Kit SP2
    OS: Linux
    BW 701 Level 6
    Crystal Reports 2008 V1
    Thanks
    Keith

    Hi,
    Crystal Reports and Web Intelligence will only show data which is in the cube. You could have an actual 0 or Null entry whithout grouping but by changing the selection / grouping in the report the data does not include such entry anymore.
    ingo

  • Sharing complex substitution variable values between ASO and BSO databases

    We have ASO and BSO Essbase database member names with spaces in, and need to store some of these member names in substitution variables. However, this has to be done differently for ASO and BSO, due to calc script syntax requiring double quotes and MDX requiring square brackets. For example:
    ASO:
    &CurWeek value = Week 1
    MDX: [&CurWeek]
    BSO:
    &CurWeek value = "Week 1"
    Calc Script: &CurWeek
    As a result, the substitution variables cannot be shared between the ASO and BSO cubes, since the BSO variable value requires double quotes due to the space in the member name.
    Is there a way to get the above to work with both ASO and BSO? Can the double quotes be escaped in calc script syntax? Or can the double quotes be removed in the MDX formula?

    Hi TimG,
    Apologies for such a late reponse to this, genuinely haven't had a spare second to reply until now!
    Yes, I suspect a complex alias name may be the best solution here, and to remove the spaces from the actual member names.
    I was not aware of the latter part at all. My colleague has confirmed as much on this too - DBAG 11.1.2.1 pp117 & 118:
    "Note: If a substitution variable value is numeric or a member name starting with a
    numeral or containing the special characters referred to above is to be used both
    in MDX and non-MDX situations, create two substitution variables, one without
    the value enclosed in quotation marks and one with the value in quotation marks."
    "To ensure that a new substitution variable value is available in formulas, partition definitions,
    and security filters, stop and restart the application. All other uses of substitution variables are
    dynamically resolved when used."
    This last paragraph is the most concerning since we were planning to be able to update substitution variables values and then access the new values from calc scripts and formulae instantaneously. This quirk is unexpected and a little inconvenient. We may have to look at scheduling a change of substitution variable value overnight, followed by a stop/start of the app ready for the next day, and to work around needing to access changed values instantly.

  • CJ20N - project structure and data import

    Hello dear SAP specialists,
    Does anybody ever created a ABAP program to import project structure and populate it with data?
    I'm trying to start with something or get a working program to import some projects with data.
    Actually the program should use BAPI_PROJECT_MAINTAIN to create WBS and GUI_UPLOAD to read a text (cvs) file (LSMW can not be used:)
    Sincerely,
    Me

    Hi,
    Exactly!
    See you have so many tables in that BAPI, now all the data you have in your flat file you have to map to these tables.
    Below is a code...similarly you'll have to do
    TYPE-POOLS: truxs.
    *                           T Y P E S
    TYPES: BEGIN OF t_master_data,
              MATERIAL                      Type  MATNR ,
              IND_SECTOR                    Type  MBRSH ,
              MATL_TYPE                     Type  MTART ,
              PLANT                         Type  WERKS ,
              STGE_LOC                      Type  LGORT_D ,
              MATL_DESC                     Type  MAKTX ,
              BASE_UOM                      Type  MEINS ,
              MATL_GROUP                    Type  MATKL ,
              DIVISION                      Type  SPART ,
              ITEM_CAT                      Type  MTPOS_MARA  ,
              GROSS_WT                      Type  BRGEW ,
              UNIT_OF_WT                    Type  GEWEI ,
              NET_WEIGHT                    Type  NTGEW ,
              VOLUME                        Type  VOLUM ,
              SIZE_DIM                      Type  GROES ,
              BASIC_MATL                    Type  WRKST ,
              DOCUMENT                      Type  DZEINR  ,
              DOC_VERS                      Type  DZEIVR  ,
              PO_UNIT                       Type  BSTME ,
              PUR_GROUP                     Type  EKGRP ,
              AUTO_P_ORD                    Type  KAUTB ,
              "BATCH_MGMT Type  XCHPF ,
              PUR_VALKEY                    Type  EKWSL ,
              "GR_PR_TIME Type  WEBAZ ,
              COMM_CODE                     Type  STAWN ,
              COUNTRYORI                    Type  HERKL ,
              MRP_TYPE                      Type  DISMM ,
              REORDER_PT                    Type  MINBE ,
              MRP_CTRLER                    Type  DISPO ,
              LOTSIZEKEY                    Type  DISLS ,
              MINLOTSIZE                    Type  BSTMI ,
              MAXLOTSIZE                    Type  BSTMA ,
              FIXED_LOT                     Type  BSTFE ,
              MAX_STOCK                     Type  MABST ,
              ROUND_VAL                     Type  BSTRF ,
              PROC_TYPE                     Type  BESKZ ,
              SPPROCTYPE                    Type  SOBSL ,
              ISS_ST_LOC                    Type  LGPRO ,
              SLOC_EXPRC                    Type  LGFSB ,
              PLND_DELRY                    Type  PLIFZ ,
              GR_PR_TIME                    Type  WEBAZ ,
              SM_KEY                        Type  FHORI ,
              SAFETY_STK                    Type  EISBE ,
              PLNG_PLANT                    Type  PRWRK ,
              AVAILCHECK                    Type  MTVFP ,
              DEP_REQ_ID                    Type  SBDKZ ,
              ISSUE_UNIT                    Type  AUSME ,
              STGE_BIN                      Type  LGPBE ,
              BATCH_MGMT                    Type  XCHPF ,
              STGEPERIOD                    Type  MAXLZ ,
              STGE_PD_UN                    Type  LZEIH ,
              MINREMLIFE                    Type  MHDRZ ,
              SHELF_LIFE                    Type  MHDHB ,
              PERIOD_IND_EXPIRATION_DATE    Type  DATTP ,
              ROUND_UP_RULE_EXPIRATION_DATE Type  RDMHD ,
              STOR_PCT                      Type  MHDLP ,
              QM_AUTHGRP                    Type  QMATAUTH  ,
              QM_PROCMNT                    Type  QMPUR ,
              CTRL_KEY                      Type  SSQSS ,
    *           Type  ART ,
    *           Type  AKTIV ,
              VAL_CAT                       Type  BWTTY_D ,
              VAL_CLASS                     Type  BKLAS ,
              PRICE_CTRL                    Type  VPRSV ,
    * NEW ADDITION
              STD_PRICE                     Type  STPRS,
              PRICE_UNIT                    Type  PEINH ,
              MOVING_PR                     Type  VERPR ,
              QTY_STRUCT                    Type  CK_EKALREL  ,
              ORIG_GROUP                    Type  HRKFT ,
              ORIG_MAT                      Type  HKMAT ,
              VARIANCE_KEY                  Type  AWSLS ,
              PROFIT_CTR                    Type  PRCTR ,
              LANGU                         Type SPRAS,
           END OF t_master_data.
    *                  I N T E R N A L   T A B L E S
    DATA:
    *     Internal table of type t_master_data
          ist_master_data TYPE TABLE OF t_master_data,
    *     Internal table of type BAPIMATHEAD
          ist_headdata    TYPE TABLE OF BAPIMATHEAD,
    *     Internal table of type BAPI_MAKT
          ist_mat_desc    TYPE TABLE OF BAPI_MAKT,
    *     Internal table of type BAPI_MAKT
          ist_uom         TYPE TABLE OF BAPI_MARM,
    *     Internal table of type BAPI_MAKTX
          ist_uom_x       TYPE TABLE OF BAPI_MARMX.
    *                   G L O B A L   V A R I A B L E S
    DATA:
          it_num     TYPE num10,
    *     Global variable of type truxs_t_text_data
          it_raw     TYPE truxs_t_text_data.
    *                       W O R K   A R E A S
    DATA:
    *     Work area of type t_master_data
          wa_master_data                TYPE t_master_data,
    *     Work area of type bapimathead
          wa_bapimathead                TYPE BAPIMATHEAD,
    *     Work area of type bapi_mara
          wa_client_data                TYPE BAPI_MARA,
    *     Work area of type bapi_marax
          wa_client_data_x              TYPE  BAPI_MARAX,
    *     Work area of type bapi_marc
          wa_plant_data                 TYPE BAPI_MARC,
    *     Work area of type bapi_marcx
          wa_plant_data_x               TYPE BAPI_MARCX,
    *     Work area of type bapi_mard
          wa_storage_location_data      TYPE BAPI_MARD,
    *     Work area of type bapi_mardx
          wa_storage_location_data_x    TYPE BAPI_MARDX,
    *     Work area of type bapi_mbew
          wa_valuation_data             TYPE BAPI_MBEW,
    *     Work area of type bapi_mbewx
          wa_valuation_data_x           TYPE BAPI_MBEWX,
    *     Work area of type bapi_mard
          wa_mat_desc                   TYPE BAPI_MAKT,
    *     Work area of type bapi_marm
          wa_uom                        TYPE BAPI_MARM,
    *     Work area of type bapi_marmx
          wa_uom_x                      TYPE BAPI_MARMX,
    *     Work area of type mbapi_mpgd
          wa_planning_data              TYPE BAPI_MPGD,
    *     Work area of type mbapi_mpgdx
          wa_planning_data_x            TYPE BAPI_MPGDX,
    *     Work area of type mbapi_mpgd
          wa_return                     TYPE BAPIRET2.
    *                          P A R A M E T E R S
    PARAMETERS:
    *     Parameter of type rlgrap-filename
          p_file TYPE  rlgrap-filename.
    *               A T   S E L E C T I O N   S C R E E N
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    *                S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
    * To upload data from flat file
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header        = 'X'
          i_tab_raw_data       = it_raw       " WORK TABLE
          i_filename           = p_file
        TABLES
          i_tab_converted_data = ist_master_data[]  "ACTUAL DATA
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc = 0.
        LOOP AT ist_master_data INTO wa_master_data.
          it_num = wa_master_data-PROFIT_CTR.
          wa_master_data-PROFIT_CTR = it_num.
          MOVE-CORRESPONDING wa_master_data to wa_bapimathead.
          MOVE-CORRESPONDING wa_master_data to wa_client_data.
          wa_client_data_x-MATL_GROUP = 'X'.
          wa_client_data_x-BASE_UOM = 'X'.
          wa_client_data_x-PO_UNIT = 'X'.
          wa_client_data_x-DOCUMENT = 'X'.
          wa_client_data_x-SIZE_DIM = 'X'.
          wa_client_data_x-BASIC_MATL = 'X'.
          wa_client_data_x-PUR_VALKEY = 'X'.
          wa_client_data_x-NET_WEIGHT = 'X'.
          wa_client_data_x-UNIT_OF_WT = 'X'.
          wa_client_data_x-DIVISION = 'X'.
          wa_client_data_x-BATCH_MGMT = 'X'.
          wa_client_data_x-QM_PROCMNT = 'X'.
          wa_client_data_x-MINREMLIFE = 'X'.
          wa_client_data_x-SHELF_LIFE = 'X'.
          wa_client_data_x-STOR_PCT = 'X'.
          wa_client_data_x-ROUND_UP_RULE_EXPIRATION_DATE = 'X'.
          wa_client_data_x-PERIOD_IND_EXPIRATION_DATE = 'X'.
          wa_client_data_x-ITEM_CAT = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_plant_data.
          wa_plant_data_x-PLANT  = wa_master_data-plant.
          wa_plant_data_x-PUR_GROUP = 'X'.
          wa_plant_data_x-ISSUE_UNIT = 'X'.
          wa_plant_data_x-MRP_TYPE = 'X'.
          wa_plant_data_x-MRP_CTRLER = 'X'.
          wa_plant_data_x-PLND_DELRY = 'X'.
          wa_plant_data_x-GR_PR_TIME = 'X'.
          wa_plant_data_x-LOTSIZEKEY = 'X'.
          wa_plant_data_x-PROC_TYPE = 'X'.
          wa_plant_data_x-SPPROCTYPE = 'X'.
          wa_plant_data_x-SAFETY_STK = 'X'.
          wa_plant_data_x-MINLOTSIZE = 'X'.
          wa_plant_data_x-MAXLOTSIZE = 'X'.
          wa_plant_data_x-FIXED_LOT = 'X'.
          wa_plant_data_x-ROUND_VAL = 'X'.
          wa_plant_data_x-MAX_STOCK = 'X'.
          wa_plant_data_x-DEP_REQ_ID = 'X'.
          wa_plant_data_x-SM_KEY = 'X'.
          wa_plant_data_x-STGEPERIOD = 'X'.
          wa_plant_data_x-STGE_PD_UN = 'X'.
          wa_plant_data_x-CTRL_KEY = 'X'.
          wa_plant_data_x-BATCH_MGMT = 'X'.
          wa_plant_data_x-AVAILCHECK = 'X'.
          wa_plant_data_x-AUTO_P_ORD = 'X'.
          wa_plant_data_x-COMM_CODE = 'X'.
          wa_plant_data_x-COUNTRYORI = 'X'.
          wa_plant_data_x-PROFIT_CTR = 'X'.
          wa_plant_data_x-ISS_ST_LOC = 'X'.
          wa_plant_data_x-VARIANCE_KEY = 'X'.
          wa_plant_data_x-SLOC_EXPRC = 'X'.
          wa_plant_data_x-QM_AUTHGRP = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_planning_data.
          wa_planning_data_x-PLANT = wa_master_data-plant.
          wa_planning_data_x-PLNG_PLANT = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_storage_location_data.
          wa_storage_location_data_X-PLANT = wa_master_data-plant.
          wa_storage_location_data_X-STGE_LOC = wa_master_data-stge_loc.
          wa_storage_location_data_X-STGE_BIN = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_valuation_data.
          wa_valuation_data-VAL_AREA = '1000'.
          wa_valuation_data_X-VAL_AREA = '1000'.
          wa_valuation_data_X-PRICE_CTRL = 'X'.
          wa_valuation_data_X-MOVING_PR  = 'X'.
          wa_valuation_data_X-PRICE_UNIT = 'X'.
          wa_valuation_data_X-STD_PRICE = 'X'.
          wa_valuation_data_X-VAL_CLASS = 'X'.
          wa_valuation_data_X-ORIG_GROUP = 'X'.
          wa_valuation_data_X-QTY_STRUCT = 'X'.
          wa_valuation_data_X-ORIG_MAT = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_mat_desc.
          APPEND wa_mat_desc to ist_mat_desc.
          IF wa_master_data-PRICE_CTRL = 'S' AND wa_master_data-STD_PRICE IS INITIAL.
            WRITE:/ 'Standard Price not maintained for material ',wa_master_data-MATERIAL.
          ELSE.
            CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
              EXPORTING
                HEADDATA             = wa_bapimathead
                CLIENTDATA           = wa_client_data
                CLIENTDATAX          = wa_client_data_x
                PLANTDATA            = wa_plant_data
                PLANTDATAX           = wa_plant_data_X
                PLANNINGDATA         = wa_planning_data
                PLANNINGDATAX        = wa_planning_data_x
                STORAGELOCATIONDATA  = wa_storage_location_data
                STORAGELOCATIONDATAX = wa_storage_location_data_x
                VALUATIONDATA        = wa_valuation_data
                VALUATIONDATAX       = wa_valuation_data_x
              IMPORTING
                RETURN               = wa_return
              TABLES
                MATERIALDESCRIPTION  = ist_mat_desc.
            Write:/ wa_return-message.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            Clear: wa_bapimathead
             ,wa_client_data
             ,wa_client_data_x
             ,wa_plant_data
            ,wa_plant_data_X
            ,wa_planning_data
             ,wa_planning_data_x
            ,wa_storage_location_data
             ,wa_storage_location_data_x
             ,wa_valuation_data
           ,wa_valuation_data_x.
          ENDIF.
          REFRESH ist_mat_desc.
        ENDLOOP.
      ELSE.
        Write:/ text-001.
      ENDIF.
    In the above code note how i have taken the same names for the fields in internal table as they are in the BAPI so that the mapping of data becomes easier, since i use MOVE CORRESPONDING.
    Regards,
    Shraddha
    Edited by: shraddha85 on Jan 31, 2011 9:49 AM

Maybe you are looking for