VERY  URGENT FUNCTION MODULES

i have retrieved data from mseg and stored in one table where werks in s_werks .
MJAHR
ZEILE
BWART
MATNR
MENGE
MEINS
ztable : contains BWART and indicator field indc.
Now this i_mseg data will be totaled on Material and plant.
Issued qty at material and plant level, will be calculated with following logic,
i. (Sum of all MSEG-MENGE where MSEG-BWRAT=Z_tab-BWRAT and z_tab-indc= “x”) – (Sum of all MSEG-MENGE (where MSEG-BWRAT=z_tab-bwart)and z_indc = “y”)
Regards
SAISRI

1.sum = need to sum the quantity where ztable movement type is equal to i_mseg -bwart and ztable-indc = 'R'.(some indicator)
2.sum = and need to sum the quantity where ztable movement type is equal to i_mseg -bwart and ztable-indc = 'I'(some indicator)
and
quantity = 1 - 2.
This should be in code.
we need to loop i_mseg and write this.
This is what i am asking.

Similar Messages

  • Very Urgent Text Modules - Smartform in diff lang

    Hi,
    Could any one give me a detailed info on how to use one text module in Smartform to other languages <b>without logging</b> into the system in that language.
    I <b>tried</b> Example in the  thread containing as below nut unable to succeed.
    /: INCLUDE z_txt OBJECT TEXT ID txt LANGUAGE &Variable&
    Name: z_text
    Object: Text
    Text id: Txt (Text id from SO10)
    Language: variable[/code][/code][/code]
    Its very Urgent
    Thanks
    Dan

    Dan...
    you want to give the Language for Text elemetn dinamically..
    in genaral attributes of the Text Module winodow..
    Text name: xxxxxxx
    Text Object: Text
    Text ID: ST
    Language: as below...
    so wht i am suggesting is give the &CONTROL_PARAMETERS-REPLANGU1& (if it contain the Language)..
    in Language tab.. Press the button right side of this element ">" then the text box will be become large.. then enter &CONTROL_PARAMETERS-REPLANGU1&..
    if it is not clear plese tell wht exactly you r requirement again
    <b>Please Close this thread.. when u r problem ise solved</b>
    Reward if Helpful
    Regards
    Naresh Reddy K

  • URGENT: Function modules or BAPIs

    Hi Experts,
    I need function modules or BAPI to get the open items and cleared items G/L Account wise.
    Useful replies will be surely awarded.

    Hi Chakradhar,
    Check tcode : BAPI
    u will get all bapis there.
    Regards,
    Hemant

  • Urgent: Function module for getting the input from user  using a pop up

    Hi all,
    My requirement at user commmand a pop up should appear asking the user to enter the session name for the bdc session to be created.
    My report allows the user to enter the session name of his choice.
    I need the name of the function module which can do this.
    Thanks
    Pritish

    better to create one FM  to pop-up.
    check this :
    function y_pop_up_get_distributor_time.
    *"*"Local interface:
    *"  IMPORTING
    *"     REFERENCE(W_ROUTE) LIKE  VBAP-ROUTE
    *"     REFERENCE(W_VBELN) LIKE  VBAK-VBELN
    *"     REFERENCE(W_VGBEL) LIKE  VBAK-VGBEL
    *"     REFERENCE(W_VSTEL) LIKE  VBRP-VSTEL
    *"     REFERENCE(W_AUART) LIKE  VBAK-AUART
    *"  EXPORTING
    *"     REFERENCE(W_FROM_DATE) TYPE  SY-DATUM
    *"     REFERENCE(W_FROM_TIME) TYPE  SY-UZEIT
    *"     REFERENCE(W_TO_DATE) TYPE  SY-DATUM
    *"     REFERENCE(W_TO_TIME) TYPE  SY-UZEIT
    *"     REFERENCE(W_TKNUM) TYPE  VTTK-TKNUM
    *"     REFERENCE(W_RC) TYPE  SY-SUBRC
    *"     REFERENCE(W_DEPT_DATE) TYPE  SY-DATUM
    *"     REFERENCE(W_DEPT_TIME) TYPE  SY-UZEIT
    *"     REFERENCE(W_REPO_DATE) TYPE  SY-DATUM
    *"     REFERENCE(W_REPO_TIME) TYPE  SY-UZEIT
    *"     REFERENCE(W_PLNT_DATE) TYPE  SY-DATUM
    *"     REFERENCE(W_PLNT_TIME) TYPE  SY-UZEIT
    *"     REFERENCE(W_TRUCK_NO) TYPE  YW2_TIMEENTRY-TRUCKNO
    *"     REFERENCE(W_LIFNRN) TYPE  YW2_TIMEENTRY-LIFNR
    *  SET PF-STATUS 'STATUS_100' OF PROGRAM SAPLZ2SLS.
    *CLEAR:W_DATE_FROM, W_DS_TIME_1, W_ADATE,
    *      W_ATIME,W_BDATE,W_BTIME, W_CDATE, W_CTIME.
    clear : w_route1, w_vbeln1,w_vgbel1,
            w_vstel1,w_auart1.
      w_route1 = w_route.
      w_vbeln1 = w_vbeln.
      w_vgbel1 = w_vgbel.
      w_vstel1 = w_vstel.
      w_auart1 = w_auart.
      clear: w_date_to, w_date_from, w_adate,w_atime,
             w_ds_time_1, w_ds_time_2,
             w_bdate, w_btime, w_cdate, w_ctime.
      call screen 100 starting at 10 2 ending at 115 13.
      if w_ok_code = 'SAVE'.
        w_rc = 0.
        w_from_date  = w_date_from.
        w_from_time  = w_ds_time_1.
        w_to_date    = w_date_to.
        w_to_time    = w_ds_time_2.
        w_tknum      = w_tknum.
        w_dept_date  = w_adate.
        w_dept_time  = w_atime.
        w_repo_date  = w_bdate.
        w_repo_time  = w_btime.
        w_plnt_date  = w_cdate.
        w_plnt_time  = w_ctime.
        w_truck_no   = sg_truckno.
        w_lifnrn     = w_lifnr.
      else.
        w_rc = 1.
      endif.
    *  IF w_ok_code = 'CANC'.
    *    W_rc = 1.
    *  ELSE.
    *    W_rc = 0.
    *    W_FROM_DATE  = w_date_from.
    *    W_FROM_TIME  = w_ds_time_1.
    *    W_TO_DATE    = w_date_to.
    *    W_TO_TIME    = w_ds_time_2.
    *    W_TKNUM      = W_TKNUM.
    *    W_DEPT_DATE  = W_ADATE.
    *    W_DEPT_TIME  = W_ATIME.
    *    W_REPO_DATE  = W_BDATE.
    *    W_REPO_TIME  = W_BTIME.
    *    W_PLNT_DATE  = W_CDATE.
    *    W_PLNT_TIME  = W_CTIME.
    *  ENDIF.
      clear w_ok_code.
    endfunction.
    Regards
    Prabhu

  • Urgent:Function-module

    Hi Experts,
       As i was using the function module in my program EDITOR_SYNTAX_CHECK for checking the errors,warnings and upgrade for a particular program. But this function module is not catching the data dictionary fields error of new version(6.0).Instead of this function module is their any new function module to check the errors,warnings and upgrade for a particular program.
    Please let me know if you have any queries.
    Thanks in advance,
    aadi.

    Try with the below code;
      DATA:
        l_err_mess(120) TYPE c,
        l_err_line      TYPE i,
        l_err_word(120) TYPE c.
      SYNTAX-CHECK FOR t_source_code
               MESSAGE l_err_mess
                  LINE l_err_line
                  WORD l_err_word
               PROGRAM p_program.
      IF sy-subrc NE 0.
      ENDIF.
    Regards,
    Kiran Bobbala

  • Standard function module inside a loop.

    Hi Experts,
    I am trying to improve performance program that has a standard abap function module inside a loop. I am some what lost on what to do here. Here below is what the code looks like as of now. I have read that i need to try and not use the function module at all be it is a very complicated function module. Any suggestions will be appreciated.
    DATA: tl_retorno TYPE bapireturn1 OCCURS 0 WITH HEADER LINE. "Retorno
       DATA: wl_bukrs   LIKE acct_det_bf-comp_code,     "Empresa
             wl_process LIKE acct_det_bf-process,       "Chave
             wl_symko   LIKE hrpp_acct_det-symb_acct,   "Conta Simbólica
             wl_momag   LIKE hrpp_acct_det-eg_acct_det, "Agrupamento
             wl_razao   LIKE acct_det_bf-gl_account.    "Conta Razão
    *-->                  <--*
       SORT tg_rubcr BY bukrs lgart.
       LOOP AT tg_rubcr.
         CLEAR: wl_bukrs, wl_process, wl_symko, wl_momag, wl_razao.
         wl_bukrs   = tg_rubcr-bukrs.
         wl_process = tg_rubcr-process.
         wl_symko   = tg_rubcr-symko.
         CLEAR tg_aux.
         IF tg_rubcr-u_momag IS INITIAL. "A rubrica necessita de agrupamento?
           CLEAR wl_momag.
    * Busca Contas Razão sem Agrupamento de Empregados
           CALL FUNCTION 'HRPP_FI_ACCT_DET_HR'
             EXPORTING
               companycode              = wl_bukrs
               process                  = wl_process
               symb_acct                = wl_symko
               eg_acct_det              = wl_momag
               add_modif                = ' '
             IMPORTING
               gl_account_debit         = wl_razao
    *         GL_ACCOUNT_CREDIT        =
    *         POSTING_KEY_DEBIT        =
    *         POSTING_KEY_CREDIT       =
    *         ACCOUNT_TYPE             =
             TABLES
               return_tab               = tl_retorno.
           tg_rubcr-razao = wl_razao.
           tg_aux = tg_rubcr.
           APPEND tg_aux.
         ELSE.  "Não necessita de agrupamento de empregado?
           LOOP AT tg_t52em. "Para todos os agrupamentos
             CLEAR tg_aux.
             CLEAR tl_retorno.
             REFRESH tl_retorno.
             CLEAR wl_momag.
             wl_momag  = tg_t52em-momag.
    * Busca Contas Razão com Agrupamento de Empregados
             CALL FUNCTION 'HRPP_FI_ACCT_DET_HR'
               EXPORTING
                 companycode              = wl_bukrs
                 process                  = wl_process
                 symb_acct                = wl_symko
                 eg_acct_det              = wl_momag
                 add_modif                = ' '
               IMPORTING
                 gl_account_debit         = wl_razao
    *           GL_ACCOUNT_CREDIT        =
    *           POSTING_KEY_DEBIT        =
    *           POSTING_KEY_CREDIT       =
    *           ACCOUNT_TYPE             =
               TABLES
                 return_tab               = tl_retorno.
             tg_rubcr-razao = wl_razao.
             tg_aux = tg_rubcr.
             tg_aux-momag = tg_t52em-momag.
             APPEND tg_aux.
           ENDLOOP.
         ENDIF.
       ENDLOOP.
    * Limpa tabela com rubricas e move todo o conteúdo da auxiliar
       REFRESH tg_rubcr.
       CLEAR tg_rubcr.
       tg_rubcr[] = tg_aux[].
    ENDFORM.                    " busca_conta_razao

    Hi Patrick,
    If you do not want to use the function module then the other option that you can use is do selects from the tables that the FM 'HRPP_FI_ACCT_DET_HR' is using to get the importing "parameter  gl_account_debit         = wl_razao"  outside the loop.
    So steps will be:
    Debug FM 'HRPP_FI_ACCT_DET_HR'  to find out how it getting importing data using exporting parameters.
    Then before the loop is called do a select for all entries on table tg_rubcr. And id muliple tables are used Read statements to populate a final table with gl_account_debit         = wl_razao value.
    Then use the final table to get this value inside the loop.
    Please let me know if you need more details.

  • Function module CS_BOM_EXPL_MAT_V2 Documentation

    I cannot find any documentation for function module CS_BOM_EXPL_MAT_V2.  It is a very powerful function module, however, it is not useful without documentation.  I know that it can do single level boms as well as multi level and a host of other things, but I can only guess without documentation.  Do you know where I can get documentation for this function module. 
                        thank you in advance, Leonard Getz, Dy4 Systems Inc. Ottawa, Ontario, Canada.

    This is what I found:
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2' "BOM explosion for material
    EXPORTING
      ftrel = SPACE               " csdata-xfeld  Limited multi-level - stop explosion at items not relevant to production
      aufsw = SPACE               " csdata-xfeld  Determine and enter order level and channel
      aumgb = SPACE               " csdata-xfeld  Calculate scrap quantity
      aumng = 0                   " stko-bmeng    Scrap quantity
      auskz = SPACE               " csdata-xfeld  Scrap
      bagrp = SPACE               " mara-matnr    Assembly restriction
      beikz = SPACE               " stpo-beikz    Material provision indicator
      bessl = SPACE               " csdata-xfeld  Material provision selection indicator
      bgixo = SPACE               " csdata-xfeld  Load assembly information for exploded assemblies only
      brems = SPACE               " csdata-xfeld  Limited explosion
      capid = 'STD1'              " tc04-capid    Application ID
      cospr = SPACE               " csdata-xfeld  Internal: (CO) order-spec. MatPreRead
      cuobj = 000000000000000     " marc-cuobj    Configuration
      datuv = 00000000            " stko-datuv    Validity date
      delnl = SPACE               " csdata-xfeld  Delete items not kept in stock from list
      emeng = 0                   " stko-bmeng    Required quantity
      erskz = SPACE               " stpo-erskz    Spare part indicator
      erssl = SPACE               " csdata-xfeld  Spare part selection indicator
      fbstp = SPACE               " csdata-xfeld  Limited multi-level - stop explosion at externally procured item
      mbwls = SPACE               " csdata-xfeld  Read material valuation
      mdmps = SPACE               " csdata-xfeld  Limited multi-level - explode phantom assemblies at least
      mehrs = SPACE               " csdata-xfeld  Multi-level explosion
      mkmat = SPACE               " csdata-xfeld  Limited multi-level; explode KMAT
      mmaps = SPACE               " csdata-xfeld  Limited multi-level - explode at least M assembly (M order)
      mmory = SPACE               " csdata-xfeld  Memory use ('1'=on;'0'=off;' '=no reaction)
      mtnrv = SPACE               " mara-matnr    Material
      postp = SPACE               " stpo-postp    Item category
      rndkz = SPACE               " csdata-xfeld  Round off: ' '=always, '1'=never, '2'=only levels > 1
      rvrel = SPACE               " stpo-rvrel    Relevant to sales
      sanfr = SPACE               " stpo-sanfe    Production
      sanin = SPACE               " stpo-sanin    Maintenance
      sanka = SPACE               " stpo-sanka    Costing
      sanko = SPACE               " stpo-sanko    Engineering/design
      sanvs = SPACE               " stpo-sanvs    Shipping
      schgt = SPACE               " stpo-schgt    Bulk material
      stkkz = SPACE               " stpo-stkkz    PM assembly
      stlal = SPACE               " stko-stlal    Alternative BOM
      stlan = SPACE               " stzu-stlan    BOM usage
      werks = SPACE               " marc-werks    Plant
      mdnot = SPACE               " csdata-xfeld  Restriction on MDMPS: do not explode M phantom
      panot = SPACE               " csdata-xfeld  Restriction on MDMPS: no parallel discontinue
      IMPORTING
        topmat =                    " cstmat        Data for start material
        dstst =                     " csdata-xfeld  Structure destroyed by filter
      TABLES
        stb =                       " stpox         Collective item data table
      matcat =                    " cscmat        Material catalog (sub-assemblies)
      EXCEPTIONS
        ALT_NOT_FOUND = 1           "               Alternative not found
        CALL_INVALID = 2            "               Incorrect parameter combination
        MATERIAL_NOT_FOUND = 3      "               Material not found
        MISSING_AUTHORIZATION = 4   "               No authorization (bill of material)
        NO_BOM_FOUND = 5            "               No BOM for this material
        NO_PLANT_DATA = 6           "               Material not maintained in plant
        NO_SUITABLE_BOM_FOUND = 7   "               BOM does not exist
        .  "  CS_BOM_EXPL_MAT_V2

  • Very urgent help needed in activating a function module

    Hello experts.
    I had a standard report and i copied into an z report. i need to change some field output , and that field is there in a standard function module.so i copied that fun module  into z fun module and stored in a new fun group. Now it is showing the error in the z fun module. include in the fun module is giving the error stating that it is not existing. please help me in coping the standard fun module correctly . please its very urgent.

    Hi,
    You should not copy a Function module alone, as it will have some dependant INLCUDES and global data in TOP include of the function group.
    SO if you want the function module copy the entire Function Group into Z function group.
    Regards,
    Sesh

  • I'm very new tp SAP ABAP, how to create a function module..V.URGENT

    hi folks,
    I'm very new to sap abap.
    I want to create a function module.
    the following is my requirement.
    by passing(eporting parameters to funtion module from pgm point of view) a field, i want to get(importing parameters from the funtion module, from pgm point of view) some 7 fields(of various tables).
    please also tell me how can code an inner join for tables 5 tables(a,b,c,d,e). i'm joining a on b, b on c, c on d,the problem here is that i can not join d on e as there are no common fields in d and e.
    can i join e and c or b, there are no common fields even in a and e.
    please tell me the solution as soon as possible, this very important and urgent deliverable.
    thanks in advance

    Here is link for creating function modules
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm">Creating Function Modules</a>
    Regds
    Manohar

  • Update Equipment BOM using Function module (very urgent)

    Hi All,
    I am an ABAPER and trying to update equipemnt BOM.
    I want to update equipment BOM using a function module. I am currently using 'CSAI_BOM_MAINTAIN' function module. But i am not able to update the Equipment BOM. After function call the sy-subrc value is 0, even though the BOM is not updated.
    Please help its very urgent.
    Kind Regards,
    Sharat.

    Hi Sharat,
    I am facing the same problem. Could you please let me know what might be the reason.
    Plz mail me at [email protected]
    Plz update this section once u have mailed the answer.
    Thanks a lot in advance.
    Regards,
    Himanshu

  • Regarding a Change Document Function Module ----- VERY VERY Urgent

    I am using a Change Document Function module "CHANGEDOCUMENT_READ". It is taking a long time.
    I am using the parameters:
    Start date is the first date of the current month
    Enddate as last date of the current month
    Object class as 'MATERIAL'
    Table Name as 'MBEW'

    Hi ,
    When you want to read the change documents, please follow the below process.
    1. Read the change documents headers with function modules
    call function 'CHANGEDOCUMENT_READ_HEADERS'
           exporting
                date_of_change             = cdhdr-udate
                objectclass                = cdhdr-objectclas
                objectid                   = cdhdr-objectid
                time_of_change             = '000000'
                username                   = cdhdr-username
           tables
                i_cdhdr                    = gt_cdhdr
           exceptions
                no_position_found          = 1
                wrong_access_to_archive    = 2
                time_zone_conversion_error = 3
                others                     = 4.
    2. From above step you will get data of change documents very quickly into Itab (gt_cdhdr)
    3. Read the details on change documents with functiion module by using Itab in loop for each document.
      loop at gt_cdhdr.
        call function 'CHANGEDOCUMENT_READ_POSITIONS'
             exporting
                  changenumber            = gt_cdhdr-changenr
             importing
                  header                  = cdhdr
             tables
                  editpos                 = gt_cdshw
             exceptions
                  no_position_found       = 1
                  wrong_access_to_archive = 2
                  others                  = 3.
    Above is the best way to read the change documents.
    Rewards please if above info is useful.
    Thanks.

  • Very Urgent Please function module FAGL_GET_TT_DATA_LEAD  Enhancement

    Hi Guys,
    I want to enhance the function module FAGL_GET_TT_DATA_LEAD (that gets the data from FAGLFLEXT) to read the FAGLFLEXA table.Can any one get me an idea on how to enhance it ....
    If possible please send me brief code steps aswell ...
    Thanks in adnvace

    hi Harish,
      One thing you can do is copy the function module into Z-function module and try to incorporate the custom code and replace the standard function module with custom function module in your program.
    Hope it helps...

  • Very important and urgent - i need info regarding a function module

    hi all,
    can any one suggest me a function module which calculate the
    difference in two dates and give answer in days.
    some one suggest me the following function m odule
      CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
           EXPORTING
                beg_da     = wpv_dati
                end_da     = wpv_datf
           IMPORTING
                no_cal_day = wpv_days
    Please suggest any other function module.
    or i can use this Function module only

    Hi,
      U can use the following function  module.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        I_DATUM_BIS                   = date1
        I_DATUM_VON                 = date2
      I_KZ_EXCL_VON              = '0'
      I_KZ_INCL_BIS                 = '0'
      I_KZ_ULT_BIS                  = ' '
      I_KZ_ULT_VON                = ' '
      I_STGMETH                     = '0'
      I_SZBMETH                     = '1'
    IMPORTING
        E_TAGE                        = days
    EXCEPTIONS
      DAYS_METHOD_NOT_DEFINED       = 1
      OTHERS                        = 2
    Reward if useful.
    Regards,
    Rajesh Akarte

  • Function Module to Update the values in STPO!! VERY URGENT!!!!!!!!!!!!!!!!!

    Hi All,
    Can any one tell me is there any Remote function module to update the values of components in STPO table while creating Sales order BOM, Material BOM, and WBS BOM. For example I want to update the Spare Part Indicator for Item components based on Plant.
    Please do the needful..
    Regards
    Yathish

    Hi Naren,
    Thanks for ur reply,
    The BAPI that you have gave is to update only Material BOM. But I want to Change  and create spare part indicator for 4 BOM's, ie Sales Order BOM, Eqipment BOM and also Material BOM and WBS BOM.
    Can u please shed some light on it,so that it would be helpfull to me.
    Thanks
    Yathish

  • Function module to update the values in STPO table :   VERY URGENT!!!!!!!!!

    Hi All,
    Can any one tell me is there any Remote function module to update the values of components in STPO table while creating Sales order BOM, Material BOM, and WBS BOM. For example I want to update the Spare Part Indicator for Item components based on Plant.
    Please do the needful..
    Regards
    Yathish

    For material bom: CSAP_MAT_BOM_CREATE
    and CSAP_ORD_BOM_CREATE for Order BOM.
    Regards,
    Ravi

Maybe you are looking for

  • LSMW Direct input method error

    Hi experts,    I created the LSMW using direct input method (PR Creation).    In the create batch input session step (executed) i am getting below message and follwed bt processing terminated message and going out   Transaction 0: transaction code /

  • Captivate 5.5 output to iPad

    I am using Captivate 5.5 and have created an eLearning module. I would like to know if there is an easy way to get the output file to play on an iPad. I have looked at the videos explaining how to get a developer account with Apple and convert the .x

  • Form name for F-58 tcode

    Hi Friends, Let me know the form / smartform name of F-58 transaction. Best Regards, Mahesh.

  • Moving to Office365 but keeping IronPort Appliances

    We are moving our internal e-mail system to Office365 and I'm starting to plan the mail routing.  Basically all inbound and outbound e-mail will still go through our IronPort appliances.   Outbound e-mail doesn't look too bad, but I'm wondering about

  • CLEAR Stick Atlas USB internet

    My CLEAR stick Atlas USB internet device stopped working in the Mac.  The device appears to be working correctly and works fine in my Dell laptop, however when I connect it to the Mac and open Safari it says I'm not connected to the internet.  Please