How to increment counter for line items.

Hi,
Please see the code below:
LOOP AT T_MAT INTO W_MAT.
          perform bdc_dynpro      using 'SAPMM07M' '0421'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'MSEG-ERFMG(i)'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '/00'.
          perform bdc_field       using 'MSEG-MATNR(i)'
                                        W_MAT-MATNR.
          perform bdc_field       using 'MSEG-ERFMG(i)'
                                        W_MAT-ERFMG.
          i = i+1.
      ENDLOOP.
In the above code I'm updating the line items thru BDC. Here I'm having a counter ' i '. I'm incrementing it for every loop cycle. When I run the BDC I get the error "Field MSEG-ERFMG does not exist in the screen"
Please help.
regards,
Sriram

Hi Sriram,
you code as to be changed slightly:
DATA l_counter(2) TYPE n.
DATA l_fieldname  TYPE string.
loop at t_mat into w_mat.
  MOVE i TO counter.
  CONCATENATE 'MSEG-ERFMG('  counter  ')'  INTO l_fieldname.
  PERFORM bdc_field USING 'BDC_CURSOR'
                          l_fieldname.
  i = i+1.
ENDLOOP.data l_counter(2) type n.
Regards
REA
Edited by: Ramy EL-ARNAOUTY on Jul 28, 2009 10:29 AM

Similar Messages

  • How to print vertical lines for line items?

    hi experts,
                    can any one tell me how to print vertical lines for line items in ascript?
    ive tried using sy-vline but its printing jus one line each for each item .i want it in columns ?if there are any control commands plz let me know how to print?
    thanks &regards
    narendar

    hi narendar,
    Welcome to SDN.
       u can go for box command.
    Use the box command with zero width for vertical lines.
    Position the line by x position and y postion.
    syntax :
    BOX <xpos> <ypos>
           <width>
          <height>
          <thickness in twips> twips.
    Regards,
    Arun.
    Reward points if useful.

  • How can i decide candidates for line item dimension?

    1Q): we have many infocubes out of all these infocubes, i have to decide which infocubes are the candidates for lineitem dimension? How to do it? Please tell me the technical specs how to do the analysis to find out the candidates for line item dimension?
    2Q): if i have the small dimension can i combine all these dimension in to one dimension? what is the benefit of doing this? how to find out which dimensions are small?
    <u>Pizzaman i like to hear from you on this topic</u>. Thanks to SDN Community. i appreciate your help. Again Thank you.

    The process of figuring out what you might want to create as a line item dimension can vary a bit, it can depend a lot on your exisitng level of domain expertise (how well do you know the data in question). If you are familiar with the data, I would recommend you just take an initial guess at what you believe could be line item dimensions.  If you are not familiar witht the data, you might want to examine the source more to understand the cardinality of different characteristics and identify any relationships between characteristics. 
    I really encourage people to just go ahead and model it and load some data and review, rather than agonizing over developing the theoretically perfect model on paper before they start. You learn a lot more that way.
    Any of the SAP rules of thumb, are just that, general rules, not a pronouncement from God.  There are always extenuating or unique circumstances that might warrant disregarding the rule, e.g. if the InfoCube will never become very large, maybe some of the concerns just are not worth your effort.
    With every release of the Oracle (and the other DBs too)Oracle keeps getting better at data warehousing and star schemas. Oracle 10i is supposed to have made handling bitmap indices much more efficient, which is on of the  factors influencing the decision to create a line item dimension.      
    There are other threads on SDN on line item dims that provide more technical detail and can help answer you first question
    As far as 2Q - generally, it's better to have several small dimensions than one larger dimension. But having said that, combining a few <b>very small dimensions</b> into another  slightly larger (<i>but still small</i>) dimension is a good idea. It keeps the number of table joins down which will improve query performance. You would do this with characterisitcs that have very few values, e.g. yes/no indicators.
    e.g.
    You have 8 characteristics that all of which have only two values. You put them in one dimension, and the max size of the dimension table is still only 2x2x2x2x2x2x2x2 or 256 rows.  If you had these characteristics in other much larger dimensions, it's not hard to see it causing those dimensions to double, perhaps creating hundreds of thousands of dimension table rows to be created.
    For more - read   <a href="http://www.kimballgroup.com/html/designtipsPDF/DesignTips2003/KimballDT48DeClutter.pdf">Ralph Kimball Design Tip 48 - Junk Dimensions</a>

  • How to mention posting keys for line items in IDOCS for fb01 posting

    Hi all ,
    I am using IDOCS for fb01 posting with posting keys 15 and posting keys 40 for line items .The data is in legacy file . I am using IDOC <b>ACC_GL_POSTING_01</b> for posting . Is there any way that I can mention the posting keys in the segment parameters of the IDOC.If there is anyone who have done fb01 posting with IDOCS,please help me with the code .Please treat the question as urgent .
    Thanks in advance

    Hi Arshad,
    There is no fecility to enter Posting keys explicitly.. It is determined automaticall by the Credit/Debit amounts u enter in GL data in the segments E1BPACGL08 and E1BPACCR08 and also it depends on the Customer and Vendor no.
    Sreedhar

  • Update the change history for line items in CDHDR/CDPOS

    Hi,
    I have a problem in updating the sales order and line items in CDHDR/CDPOS when there is change in header level custom field..
    Actually i have a custom field in VBAK which added in additional data A in the header level of sales order.When we have change in that field only some line items only updating in the change history tables(CDHDR/CDPOS),but we need to capture all the line items when the custom field in the header level is changed.
    i have added change document flag in the data element of the custom field.
    Please advice me how to get all  the line items will reflect in CDHDR/CDPOS when the header level custom field has change .
    Thanks & Regards
    Kiran

    The purpose of CHANGE DOCUMENT tables is to flag the changes with Old and New values. So when Header data is changed only Header details will be tracked and same for Item tables too.
    If you need anything addtional from this then that would customizing.
    I am not sure what is your requirement but to make it simple and achive requirement add same field with same setting to line item tables VBAP, VBKD.. (as required, if that's doesnt impact your Order. These fields no need to be on screen). While changing your Custom field of Header level change the item level field too. Then CHANGE DOCUMENT will generate automatically for all the line item including header.

  • Create delivery  document for line item 5 only manually

    Hi Sap Experts,
    We have scenario, we have created sales order with 10 line items while creating delivery we don’t want to show all the 10 line item to delivery creator (creating delivery manually).
    We will send him mail saying that create delivery  document for line item 5 and we will provide him material number and delivery date and shipping point with sales order number.
    We don’t want to use partial delivery option that split the delivery and we don’t want to use VL10C tcode also.
    What are options we have and how to customize this scenario?
    Kindly suggest.
    Regards,
    Kotli

    Can you be clear in your requirement?
    One requirement is user should not select line items other than the one instructed to them
    The other requirement is delivery split should happen based on item category
    If your requirement is first one, you need to go with user exit USEREXIT_MOVE_FIELD_TO_LIPS in include MV50AFZ1 but I am not sure, on what logic, coding to be included in this exit.  If your requirement is second one, then just try in your system and share the outcome how system is functioning.  You will come to know how standard SAP works.
    G. Lakshmipathi

  • Adding a characteristics to AR Drill down report for line items

    I have raised an OSS note on this, but they deem this to be consulting.
    I have an AR drill down report for line items
    It calls the structure RFRRD20.
    I need to add a value into the characteristics so I can use it in the drill down report.
    I have appended the structure, added a value in TKAF for the field, and it still does not show.
    Has anybody done something similar?
    I am sure this is easy, but only when you know how, so if you know how to do it please can you let me know.
    thanks
    Mark

    Hi Mark
        I am also in the same situation where i need to add two characteristics (invoice date, due date) to the AR drill down reports. I added them to the structure and TKAF table as you did, but still could not get them to the drill down reports (FDI5 or FI1).
       From your posts, i see that SAP's response was that it is not possible to add characteristics to AR drilldown reports? Did they mention any reasons or OSS notes? How did you handle your requirement, were you able to work around?
       Your suggestions would be highly appreciated.
    Thanks
    Vamsi

  • Additional fields for line item display for Vendor Accounts

    Hi,
    The additional fields for line item display have been defined for the vendor accounts. I am able to see the additional fields in SAP 4.7 system but not in ECC 6.0.
    Could you help me to know how the same will be displayed in ECC 6.0 system.
    Thanks

    In SPRO, Vendor Accounts -> Line Items -> Display Line Items -> Define Additional fields for Line item display, the fields for Check number from (PAYR-CHECF) and Tax Jurisdiction (BSEG-TXJCD) have been defined.
    When I am executing Vendor Line Item display (FBL1N), I am not able to select these fields for defining a layout. Could you please let me know, how I will get these fields in FBL1N.
    Thanks

  • Error Handling in table control for line item.

    Hi,
    Please how to do error handling in table control for line item in bdc,i have used format_message for header but i don't no fill decamps internal tabled and  how to do background processing in call transaction.
    Thanks

    Background processing is not possible using call transaction method.
    You can create an executable program which can have CALL TRANSACTION BDC code. And this can be run in background.
    What do you exactly mean by Error handling for Items in table control. Can you give some more details.

  • I want a push button for line items in my sales order entry screen.

    Hi,
    I want a push button for line items in my sales order entry screen.
    How can I do so?
    Thanks.

    Hi Kumar ,
    To have a push buttons you need to first assign a pf-status .
    here a sample code for a push button and its handling :
      set pf-status 'SELECT' .
    at user-command .
      describe table t_lpr lines w_lines .
      case sy-ucomm .
        when 'SELECTALL' .
          set pf-status 'SELECT' excluding 'SELECTALL' immediately.
          do w_lines times .
            read line w_line field value w_check . " INTO W_CHECK .
            if w_check = space .
              w_check = 'X' .
              modify line w_line field value w_check.    "INTO W_CHECK .
              add 1 to w_line .
            endif .                        " IF W_CHECK = ' '
          enddo .
    Thus when you say pf-status say 'select' , Double click on that and you find a screen eher you can select icons and assign a function code to it!
    Hope it helps!
    Much Regards,
    Amuktha .

  • How can find number of line item?

    HI All.
    I have one internal table it has PO number ,line item and quantity.
    Each PO number have number of Line item ,
    now i want find how many line item per Po number .I need find for line item for all Po number.please help me
    Thanks.
    Jay

    see the below code and i tested and it is working well.
    data : begin of i_ekpo occurs 0,
           ebeln like ekpo-ebeln,
           ebelp like ekpo-ebelp,
           end of i_ekpo.
    data v_count type i.
    start-of-selection.
    select ebeln ebelp from ekpo into table i_ekpo.
    loop at i_ekpo.
    v_count = v_count + 1.
    at end of ebeln.
    write:/ i_ekpo-ebeln,v_count.
    clear : v_count.
    endat.
    endloop.
    Reward points if it is helpful
    Thanks
    Seshu

  • How do I add PO line item to incomplete log procedure

    Hi SD Experts,
    How do I add PO line item to incomplete log procedure for VA02? Is that possible through configuration and/or code? if it is done by code, what userexit or BAdI I need to implement?
    Thanks,
    Duy

    Hi Duy,
    You need to go to SD > Basic functions > log of incomplete items > define incomplete procedure > select group A (sales header) > procedures > select 11 (Sales order) > fields tab and add PO number incompletion fields as below:
    table---field namedescriptionscreen--status--warning
    VBKD---BSTKDPO number-KBES     -
    0----
    X
    Finally, you should assign your incompletion procedures to your sales doc. typ.
    I hope these will work.
    Regards,

  • Generate sequence nuumber for line items.

    Hi,
    Am using jdeveloper 11.1.1.6.0
    I have generated a form using master detail. po_header as master and po_line as child in po_line i need to generate the sequence number.
    The problem am facing is
    If i generate using create sequence in my DB. Its working fine.
    consider
    I have po_number 1234 for this po_line while i click the add button the sequence number is added. for eg: form 1 to 10 i have the po_line against po_number.
    If am created another po_number 12345 for this while i click the add button the sequence number starts from 11...., But it need to be started from 1 since its a different po.
    Could anyone help me how to acheive this?
    Regards,
    Prasad K T,

    Hi,
    in addition, have a look how you would model the line items in a database schema. Here you would have purchase orders and line items in separate tables that are linked with a foreign key. To uniquely address line items you would have a unique sequence in the line items table. What you are looking for is a combined key (purchase order AND line item ID) to have line items numbered 1 .. 10 (this however, from a database design aspect makes no sense).
    Frank

  • Need a scenario where we go for line item diemension?

    can anyone explain the senario where we use the line item dimension ?
    and how we know that size of dimension is more than fact tablw?

    Hi
    You need to roughly estimate that if you put two characteristics in one dimension means,
    say plant and material
    say there are 100 plants and 1000 materials...
    then your dimension table will have 100 * 1000 = 100000 entries.so your fact table need to contain 100000 entries for these two chars...
    .instead of putting these two into one dimension...if you put two dimensions...total entries in two dimensions are 100 + 1000= 1100...so your fact table contains 1100 entries...right???
    so you need to think like this...if you feel that  a characteristic may contains high cardinality then you have to go for line item dimension
    run program
    sap_infocube_designs
    this will give the fact to dimension rations of all your cubes and indicate if the cube is balanced or not.
    Hope it helps
    Thanks
    Teja
    Message was edited by:
            Teja badugu

  • Changing the default view for Line Items in an Auction.

    Hello All,
    We have a version 5 client who is asking for us to change the default view for line items in an auction.
    Currently, if you have an auction setup, and you go to the Line Items tab, the default view is the "Basic View". The client would like to change the Default from "basic view" to "price view".
    Is there a way to change this default in the system? Can this be configured using query groups? Any information would be helpful.

    Hi wood cloud,
    This is not possible, bcz there is no VLV for that drop down and we cant set it  to the price view.
    Thanks,
    Ankur Goyal

Maybe you are looking for

  • Finder window won't open on the desktop when rebooting in Lion

    One problem that I have is: I always have a finder window open on my desktop. In Lion 10.7.1, when I shut down and restart my Macbook Pro (15 inch early 2008), the finder window will appear momentarily then close itself, leaving empty desktop and dri

  • Trying to Validate the name of a file with a Validator

    Hi, Im trying to validate an file name that is sent with a form I want that the Validator Checks if the filename ends with some extensions (.jpg ,etcc) for only addmit one type of files (images) I ve build my own Pluggable Validator , but I dont know

  • Drop Zones in DVDSP menu templates

    I like to occasionally use the menu templates that come with DVDSP. One thing that frustrates me is the quality of the playback video in the Drop Zone of the template. The image has a somewhat jagged/blocky look to it. It is not as smooth and clear a

  • Podcasts appear in Songs section as well

    Hiya, does anyone know how to stop my podcasts appearing in my songs section also? They used not do this but then a while ago (maybe after an update?) they started to appear. I mainly use shuffle, so is a bit of a pain when a podcast kicks in. Cheers

  • Oradm

    while I am creating dataguard on solaris 10 by oracle 11g I need to create standby database manually. but I face problem that I could not create Oracle Instance by oradim. so can anybody tell me how to create the instance on solaris. thank you