Additional Field and writing code in Infoset

Hello experts
I need to use infoset as a data source in segmentation. We created our own infoset by joining 2 table (sales table and pricing table). We need to use total gross value per customer, so we need addtional field in ınfoset for storing it. (first we calculate the total gross value and store it in additonal field in infoset.)
We create additonal field and write a code (create internal table and try to fill it etc.) However it doesn't work, we checked the same code from se38, ABAP editor and it works.
So we'd like to learn that whether the syntax in infoset different, or how can we write our own code and store value in additonal value in infoset.
Thanks in advance
M.

Hi Saipriya
the code :
data : begin of itab occurs 0,
partner_no like crmd_order_index-partner_no,
gross_value like crmd_pricing_i-gross_value,
end of itab .
data : begin of wa occurs 0,
partner_no like crmd_order_index-partner_no,
gross_value like crmd_pricing_i-gross_value,
end of wa .
data : begin of itab2 occurs 0,
partner_no like crmd_order_index-partner_no,
gross_value like crmd_pricing_i-gross_value,
end of itab2 .
data : begin of wa2,
partner_no like crmd_order_index-partner_no,
gross_value like crmd_pricing_i-gross_value,
end of wa2 .
START-OF-SELECTION.
select partner_no
       gross_value
into CORRESPONDING FIELDS OF TABLE itab
from crmd_order_index join crmd_pricing_i on crmd_order_index~item eq
crmd_pricing_i~guid
where crmd_order_index~process_type_ix = 'ZTA'
  and crmd_order_index~pft_1 = 'X'  .
LOOP AT itab INTO wa .
      MOVE-CORRESPONDING wa TO itab2.
  COLLECT itab2.
ENDLOOP.
LOOP AT itab2 INTO wa2 .
APPEND BP_GROSS.
actually we don't know how can we benefit from this code in infoset.
table1 :CRMD_ORDER_INDEX (the table we take customer number (CRMD_ORDER_INDEX-PARTNER_NO))
table2 : CRMD_PRICING_I (We take gross value form this table)
We added BP_GROSS field (adtiona filed to infoset) and would like to append the value we have from the code (Total gross per Customer) but it doesn't work in infoset.
Thanks in advance.
M.

Similar Messages

  • Add color to an Additional Field inside a SAP Query (Infoset) in ALV

    I made an Infoset (transaction SQ02) out of table MARC. I created an Additional Field called "STATUS" which I coded to get a value of 1 or 2 depending on the value of another field in MARC.
    How can I make this cell in the resulting Query to appear in different colors depending on the value? I found the command "FORMAT" but that doesn't work on SAP List Viewer (ALV) mode.
    This is what I coded in the additional field called STATUS::
    clear: STATUS.
    if MARC-DISPO = 001.
      format intensified color = 6.
      move '1' to STATUS.
    else.
      format intensified color = 7.
      move '2' to STATUS.
    endif.
    The coloring didn't work. What ABAP command should I add to this additional field to make the coloring of the STATUS cell work under ALV mode?

    field catalog and layout are saved into database aqrdb
    just before displaying the results into ALV table, they are retrieved by function RSAQRT_ALV_DISPLAY which does
    concatenate rtmode-act_report sy-langu into l_srtfd_pattern.
      import fieldcat = fieldcatalog
             layout   = layout
             sort     = sort
             from database aqrdb(lv) id l_srtfd_pattern.
    so in order to display some cells with a different color, you have to
    - add an additional field that will contain the color codes of cells
    - set values in this field at record level (field is a table of type LVC_T_SCOL)
    but also adapt the layout in order to set the field as containing the colors
    - put the name of this field into layout (CTAB_FNAME)
    - export layout to corresponding entry of aqrdb
    this part I don't see exactly where to put it, I guess there is some place where it is possible to manage the layout - if not then you have to do it "manually" i.e. with a small report

  • Sap Query Additional Fields using  Abap Code

    Hi Experts,
    I am relatively new to the world of SAP query (Log Database PNPCE), I have written a number of additional fields to retrieve previous info-type data using the select statement E.G
    prev_endda = p0008-begda - 1.
    SELECT  single bsgrd
          INTO FTE1
          FROM
            pa0008
          WHERE pernr EQ  P0008-pernr
          AND   endda EQ prev_endda
    Although I can retrieve the previous info-type data , I was wondering if there was a easy way where I could take this a step further and show the Previous , Previous record. I.E
    Pernr     FTE Current    FTE1      FTE2
    101              60%          30%       75%
    I guess what I am asking is , is there a way to loop through the HR info-type records, does anybody know if there is a standard function or macro I can use to achieve this.
    Your help is much appreciated.

    Hi ,
    Thanks for our reply.
    I have pasted some example code into my additional field which I have created in SAP Query But im not sure how the loop bit works and how I can populate the additional fields that I have created , could you please explain this
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr                 = '000000019'
        infty                 = '01'
        BEGDA                 = '18000101'
        ENDDA                 = '99991231'
      tables
        infty_tab             = p0008
      EXCEPTIONS
        INFTY_NOT_FOUND       = 1
        OTHERS                = 2
        LOOP AT p0008.
    NOT SURE WHAT TO PUT IN THIS SECTION *****
      ENDLOOP.
    I have created 3 additional Fields in the infoset Current FTE ,FTE1 FTE2 , and I want to loop through the records and populate the relevant Additional field with the employees FTE  (I only want to populate  where there is a change)
    Sample Data
    Begda              Endda             FTE        Salary
    1/1/2010         31/12/999       60%         19K          (Current  FTE)
    01/08/2009     31/12/2009     100%       27k           (FTE1)
    01/07/2008     31/7/2009         50%       17K          (FTE2)
    Thanks in anticipation
    DM

  • CUP - custom field and match code

    Hi,
    is it possible to have a custom field in CUP with a match code to help searching ?
    the only two way that i found are dropdown lists for a table from a backend system and free field ( varchar, date, numeric)
    thanks
    Regards
    Aurelien

    Hi Aurelien,
    You can create custom fields in CUP for the following types.
    1  Text type
    2 Numeric type
    3 Date type
    4 Drop down
       a) drop down data define in CUP
       b) Drop down data coming from backend table.
    If you want a request to be associated with a match code that helps you seaching the request later.
    Than create an text type custom field and use in a workflow.
    While a creating the request define the value of custom field.
    Now you can serch request on the basis of the value define in the custom field.
    Kind Regards,
    Srinivasan

  • SY - System fields and return codes in ABAP

    Hi
    I'm new to ABAP, where do I find what the meaning of the system field return codes are ?
    example SY-SUBRC returns a number of codes 0, 2, 4, 8 etc what do they mean.
    Is there a resource somewhere that provides this information for all the system fields.
    I have searched high and low and have found little, they must be defined somwhere ?
    cheers Hugh

    Here is a listing of all of the system fields.
    http://help.sap.com/saphelp_scm50/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm
    As for what the return codes( 0, 4, 8) for SY-SUBRC mean,  that is a little tricky.  The meanings of the values are dependent on what statement was used previously. They would mean different things when used with different statements.  For example, if you check SY-SUBRC after a FIND statement, the return code value 4, would mean something different than if you had check the SY-SUBRC value after doing an OPEN DATASET.  So you need to look at the specific statements in help.sap.com and see what it says about the SY-SUBRC values for each statement.
    http://help.sap.com/saphelp_scm50/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    Regards,
    Rich Heilman

  • Profit Center - Additional Fields and Screen Exits

    Hi,
    I would like to add in new fields in Profit Center (KE51).  Is it possible for Profit Center creation and if so, how to determine Screen Exit for this transaction.

    Dear!
    It is possible to add field at the master data screen of  Profit Center ( KE51) by using the Customer Enhancement ( CMOD/SMOD-screen exit/field exit).
    Please visit the following link
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/user_exits_tutorial.html
    http://www.erpgenie.com/abap/fieldexits.htm
    Please reward me point as way of thanks
    null
    Message was edited by:
            Muhammad Siddique

  • Problem with custom code in infoset query

    Hi,
    I have created a infoset. In the infoset i added a few additional fields and wrote code in the field code for those fields. I saved and generated the infoset. But in the output of the query, i am getting blank values for those additional fields. When i checked the generated program (SE38), the code is not present in the program.
    If anyone has encountered a similar problem and resolved it, please let me know where i am going wrong.
    Thanks.

    Hello,
    After adding the code for additional fields in Infoset, please syntax check and then activate the Infoset. Then the program will be regenerated with your custom code.
    Thanks,
    Venu

  • Addition of new fields and sub dields in ad hoc query

    hey all,
    hey friends i would like to know how to add additional fields and the sub fields in ad- hoc query.
    i had tried sq02 and went on creating new field but it is nt adng there and no options of sub fields are visible.
    note: i am entirely new to sap hr.. so plz try and help me out in a laymans language.

    At the Date Field, there is 1 node call the Additional fields.
    Then Right click the Additional field and choose create >> additional field.
    Then enter the field name, description, Data type and length.
    After that right click the newly created field name and choose code
    Then enter some simple code.
    E.g.
    For IT2006 the table does not provide the quota balance. If order to display the quota balance we can create an additional field call ZBalance. Then at code section enter the code ZBalance = p2006-anzhl - p2006-kverb.

  • Additional fields in infoset query can not be used as datasource fields

    I create one infoset query with additional fields (using ABAP code) in R/3. When I create datasource RSO2 using this infoset query, system only show all fields without additional fields that I enhanced in infoset query. Does that mean we can not get additional fields information in generic datasource creation that we enhanced in infoset query?

    dear Awa,
       you are enhanced some fields in r/3.right that fields are  shown in
    rsa6 select your data source click on display your datasource then select
    extract structure its shows how many fields are haveing particular
    datasource .or otherwise goto rso2 select your data source display
    double click on  your extractstructure  its show how many fields haveing
    the particular datasource. check the Rsa6 what ever fields you newly added that field default hide mode
    you remove the hide tickmark.

  • Additional field in infotype 0009 issue ( PBO and PAI )

    Hi Guru,
    I need your help please.
    I have a additional field in IT0009 and when I want created a new infotype 0009, I fill all field but after ENTER or SAVE all field are save in the layout but not the additional field.
    To save the additional field in the layout, I must fill it again and after the ENTER or SAVE the field is save in the layout.
    I have checked in the debbugger, when I create a new infotype 0009 it goes to the PBO but after ENTER or SAVE it doesn't go to the PAI so I must do it again ( fill the additional field and ENTER or SAVE ) and then it goes to the PAI.
    Thus I would like to know how I can make so that after the ENTER or SAVE the screen goes in PAI before the PBO and at the first time.
    Thanks very much in advance.
    Regards.

    Hi Srini Vas, hi Pedro Guarita and thanks for your reply,
    After more investigation, the probleme come from a check over country bank.
    In fact, the screen of the infotype 0009 must be adpated following the country bank but to do this, the standard module pool (mp000900) check if the country bank have changed.
    call method cl_hrpad00_iban=>process_iban_pai
          changing
            cs_bankdata = ls_bank_data_current
          exceptions
            error_iban  = 1
            others      = 2.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
        call method cl_hrpad00_iban=>get_bank_data_old
          importing
            bank_data_old = ls_bank_data_old.
        if ls_bank_data_current-banks <> ls_bank_data_old-banks. "MELN1357200
    bank country changed -> leave screen needs to be done
          leave_screen = 'X'.
        endif.
    But when you create a new infotype 0009, the ls_bank_data_old-banks is always initial. So when module pool compared the ls_bank_data_old-banks with the ls_bank_data_current-banks, those are always different.
    In conclusion, when you create a new infotype 0009 it is always mandatory to push ENTER before to fill any additional field because at each first time that the standard module pool go in the PAI, it make a leave screen.
    Thanks in advance for all yours reply.

  • SAP Query - Additional field that collects information from table RESB

    Hello gurus. I have a question.
    I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
    I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
    So I wrote this piece of code:
    SELECT * FROM RESB
    WHERE MATNR EQ MARD-MATNR and
           WERKS EQ MARD-WERKS.
    ENDSELECT.
    if ( sy-dbcnt NE '0').
          MOVE RESB-BDMNG to ZQTY.
    ELSE.
          MOVE '' to ZQTY.
    ENDIF.
    This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
    What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
    Could someone share some coding that would help me achieve this?

    Yes! That did it. That's what I needed to do. Thank you so much.
    While I'm at it, let me ask you a related question.
    When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
    Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this?

  • Additional field in the sales order screen

    I need some additional field in the sales order screen. There is
      also no screen exit available for VA01. Can I use this
      additional data B tab in header details by creating additional
      field in it. Please tell me how to use this tab or how to get
      different field in the sales order (header or item level).

    Hi,
       Yes. You can use this screen. For this either can modify the table VBAP with additional fields and put them on this screen.
      You have to code your logic to save these values in the include MV45AFZZ. The subscreens you have to use for this are 4462 or 8459.
    refer Screen exits - Urgent.
    with regards,
    Vamsi

  • How to create the additional field on Maintenace order

    Hi,
    For adding additional field on order -
    I am aware about the facility in SAP, in which we can create the view profile, which contains the various tab pages and the sub tab pages(Which are subscreens). When we assign this view profile the order type then we can view the various fields selected in the view profile in the order screen in IW31 T code.
    Now if i want to add some additional field then i can create the additional screen using the user exit and then assign it in customisation to the view profile and then to the order type.
    But is it possible to add the field by using any other way?
    If yes, request to let me know in detail alongwith the user exist if any.
    Thanks

    Hi all,
    Thanks for the quick reply. As per as the field key is concerned, i dont want to use that.
    I can add field by designing the new screen and adding it in the view profile but the main problem is that whenever i add the view profile to the order type, the standard tab pages are not appearing as a default and i have to add the screens as per the standard (to the view profile).
    Pete
    About IWO10018 -
    I have gone through the documention of the user exit it says that to add the additional fields on the order header, one has to append the structure CI_AUFK with the custom fields/additional fields and then use the function EXIT_SAPLCOIH_018 and 19 to transfer the data to and from the screen area to the SAP but the one point i am not sure about is how the custom fields updated in the structure will get displayed on the main screen(to input the value into them into screen) .
    Thanks
    Edited by: Raghunandan Iyer on Jul 29, 2008 2:11 AM

  • WorkManager 6 - Additional fields do not get deleted

    Hi,
    I have an issue with WorkManager 6.0 Enhancement.
    I have added custom fields to the Workorder object. To do this, I have created a ZWORKORDER class that handles these fields with its setter and getter methods and have as well created ZBAPI and ZSTEPLET classes and configured these in the config panel.
    We have added a new structure to the workorder as well.
    Downloading the information works fine - it is displayed properly and all data if handeled correctly.
    If I now delete the workorder form the device with a sync, it seem to work fine as well - until the last workorder is removed.
    If there are no workorders left, it will display text of the last order on the screen in the first tab. Some of the fields I did add are filled and the description if filled as well. The complete rest of this item is empty.
    In my finding the additional structure is removed and if I enter the Agentry Test Environment the data is gone there as well. So there is no workorder left or anything like.
    So my question: what do I have to do to remove the additional fields and clear them correctly? Do I need to change the REMOVE Bapi and Steplet or have I done wrong something else?
    Is there a guide around so I could compare if I did something wrong?
    I implemented my own ZRemove classes to be able to debug, but even that did no throw any more light on it.
    Thanx a lot for your help.
    Oliver
    Tags edited by: Michael Appleby

    Oliver,
    This is a bug in the Workmanager application.  Specifically, a bug in the Agentry platform when it attempts to clean up a Tile Display control after there are no longer any objects because of a deletion.  I have run into the scenario you are describing on another project.  You aren't doing anything wrong, but need to use some trickery to correct this.  If it is just the main detail screen that wont clean up, add another copy of the detail screen to that screenset, call it DetailEmpty or something like that.  Leave all the fields positioned as they should be, but remove all the object mappings and update rules on the fields so they never display anything.  Next add an enable rule on the new screen that checks to see if the COUNT of the workorders collection equals zero.  Put the opposite enable rule on the original detail screen that checks if workorder count > 0.  That way only one or the other screen will ever be displayed, and when there are no workorders, you will see blank fields.  This workaround is required until Agentry can correct the platform defect.
    Jason Latko - Senior Product Developer at SAP

  • SAP Query Documentation - Defining additional fields

    Hi,
    I need to create a new SAP Query defining a new Functional Area. My problem is that I have created the area and defined the tables I want to use and how to join them, but I want to add additional fields with ABAP coding. I have looked up for documentation on how to do it, and all I find is that I shoud access the menu GOTO/Additional Field, but in my screen I find no such option (I'm using 46B).
    Could anyone explain how to add additional fields and coding, or send me any documentation please??
    Also, is it possible that I can create functional areas and queries, but not edit ABAP coding from functional areas in my productive system? Do I have to create the query in my test system and transport it, or how does that work? I's my first time creating queries.
    Thanks so much in advance!

    Try
    http://www.sappoint.com/abap/ab4query.pdf
    http://www.sap-img.com/basis/transport-of-abap-query.htm
    Pl. award the points if it helps you ...
    Thanks
    Message was edited by: Saquib Khan

Maybe you are looking for