Calling MB5B from a program to determine stock on hand as on date

Dear friends,
I want to call transaction MB5b from my report passing (matnr, plant and selection date-sy-datum ) values from internal table (11500 records) and fetch the quantity field that gets displayed after executing. How to do that. can anyone write the code for that. Because writing full program for determining stock-on-hand seems meaningless as we can get that value from MB5b. Can we trap that parameter in the standard program RM07mlbd and import that parameter to the program. Any suggestions.
Please write full code. I guarantee Points would be rewarded if solved.
Regards.
D.P.Mallick

Hi,
could you please post the code how it was done. I am facing a similar issue.
Regards
Mohan

Similar Messages

  • Is it possible to call website from ABAP Program?

    Hi Experts,
           Is it possible to call website from ABAP Program?
    It is very Urgent Help me.
    Regards,
    Ashok.

    Hi,
    Check the following program:
    REPORT ZURL NO STANDARD PAGE HEADING.
    DATA: BEGIN OF URL_TABLE OCCURS 10,
    L(25),
    END OF URL_TABLE.
    URL_TABLE-L = 'http://www.lycos.com'.APPEND URL_TABLE.
    URL_TABLE-L = 'http://www.hotbot.com'.APPEND URL_TABLE.
    URL_TABLE-L = 'http://www.sap.com'.APPEND URL_TABLE.
    LOOP AT URL_TABLE.
      SKIP. FORMAT INTENSIFIED OFF.
      WRITE: / 'Single click on '.
      FORMAT HOTSPOT ON.FORMAT INTENSIFIED ON.
      WRITE: URL_TABLE. HIDE URL_TABLE.
      FORMAT HOTSPOT OFF.FORMAT INTENSIFIED OFF.
      WRITE: 'to go to', URL_TABLE.
    ENDLOOP.
    CLEAR URL_TABLE.
    AT LINE-SELECTION.
    IF NOT URL_TABLE IS INITIAL.
      CALL FUNCTION 'WS_EXECUTE'
           EXPORTING
                program = 'C:\Program Files\Internet Explorer\IEXPLORE.EXE'
                commandline     = URL_TABLE
                INFORM         = ''
              EXCEPTIONS
                PROG_NOT_FOUND = 1.
      IF SY-SUBRC <> 0.
         WRITE:/ 'Cannot find program to open Internet'.
      ENDIF.
    ENDIF.
    Regards,
    Bhaskar

  • Calling Form from Another program

    All.
    I have program A and program B. While executing Program A i need to call a perform (form) from Program B and result out this needs to flow into program A
    Like Program B having a form f_select_data
    form f_select_data.
    select * from mara into table it_mara
         where matnr  in s_matnr
    endform.
    I need to call this from program A and results back to A

    Try this:.
    In Z_PROGRAM use function
    ..PERFORM get_data_from_z_program in Y_PROGRAM.
    In Y_PROGRAM write:
    FIELD-SYMBOLS: <qals>. (example for qals table)
    * inspection lot data
    DATA: t_qals LIKE qals OCCURS 0 WITH HEADER LINE.
    DATA: wa_qals LIKE LINE OF t_qals.
       ASSIGN ('(Z_PROGRAM)QALS[]') TO <qals>.
       IF NOT ( <qals> IS INITIAL ) .
         t_qals[] = <qals>.
         READ TABLE t_qals INTO wa_qals INDEX 1.
         IF sy-subrc = 0.
           qals = wa_qals.
         ENDIF.
       ENDIF.
    hope helps..

  • Call workflow from ABAP program

    created a zbusiness object (ZPRODH)with
    one key field product hierarchy,
    one attribute level number and
    one method display.
    I tested that zobject and using this object created workflow to display product hierarchy ,it is displaying it. now I have to call it from one abap program.
    In the abap program I am calling the funcion module, I
    CALL FUNCTION 'SWW_WI_START_SIMPLE'
    EXPORTING
    TASK = TASK
    IMPORTING
    WI_ID = WI_ID
    TABLES
    AGENTS = AGENTS
    WI_CONTAINER = WI_CONTAINER.
    It is calling the workflow and subrc is 0, but not passing the value to the workflow. Because of that the method is not working, any idea?
    Thanks in advance

    ttpa,
    Please check this thread:
    Re: Workflow from abap program
    Also check that your Fm do requires any explicit commit or not?
    Hope it will help u
    Cheers
    Jai

  • How to call 'WordPad' from java program........

    The following code will open 'Notepad'
    Runtime runt = Runtime.getRuntime();
    Process pr = runt.exec( "notepad" );likewise, I want to open 'Wordpad'
    Runtime runt = Runtime.getRuntime();
    Process pr = runt.exec( "wordpad" );The above two line code, compiles successfully, but it doesn't give the correct result.
    If I give 'wordpad' in start->run->'wordpad', in windowXP means, the Runtime executer opens 'WordPad',
    can anyone give the solution to open WordPad from Java Programming.
    thanks
    Sarwan_Gres

    Try this:
            Runtime runt = Runtime.getRuntime();
            Process pr = runt.exec("cmd /c start wordpad");

  • Stock determination, Stock on hand "E"and vendor stock

    Hello all,
    I would like to know the process of stock determination and how it works. is the stock determination active only for special stocks.
    how are the consignment and special stock - "E" - stock on hand created in SAP.
    Thanks,
    Maxx

    Hi
    Consignment stock is special stock 'K' and this means that you do not own it and it is not valued until you remove the 'K and then you will have a requirement to pay for it. This needs to be done in agreement with a vendor so that they will allow you to pay only when you use it and you will need the vendoe setting up as a consignment vendor and when you create the PO you create it for special stock 'K'.
    Special stock 'E' is Sales order stock which means that the stock is allocate to a specific sales order and can only go to that sales order and if you try to pick it for anything else you should get an error.
    I hope that this helps
    Frenchy

  • "Stock on hand" at certain date.

    Hi Guys,
    I need to create a query that can tel me what the Items' "Stock On Hand" was at "A Given Date".  Can anyone point me to a Query or shed some light to this requirement.  I need to group them by a UDF and i cant see a way of doing this using STD SBO Inventory Reports.  So I will be doing it using the Queries in SBO.
    Thanks

    Found it!!!
    Using the OINM - Whse Journal, I can calculate the Items' SOH at a specific Date.

  • Call url from ABAP program

    Hi friends,
    Can we call a web URL from a ABAP program?
    Is there anyway its possible ? if yes how?
    Please provide the solution.
    Thanks & Regards
    kapil

    Hi Kapil,
    <b>Look at the below example program:-</b>
    REPORT  zget_mayors_for_cities.
    DATA: it_citymayors TYPE TABLE OF zcitymayors,
          wa_citymayors LIKE LINE OF it_citymayors,
          mayor TYPE full_name,
          trash TYPE string.
    PARAMETERS: s_city TYPE s_city LOWER CASE.
    SELECT * FROM zcitymayors INTO TABLE it_citymayors
      WHERE city LIKE s_city.
    * HTTP Client according to
    * /people/thomas.jung3/blog/2005/07/01/bsp-create-a-weather-magnet-using-xml-feed-from-weathercom
    DATA: client TYPE REF TO if_http_client,
          <b>url TYPE string,</b>
          xml TYPE xstring,
          c_xml TYPE string,
          city TYPE string.
    * Converter
    DATA: l_convin   TYPE REF TO cl_abap_conv_in_ce.
    LOOP AT it_citymayors INTO wa_citymayors.
    * Use the Progress Indicator to show the user which City is processed
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          percentage = sy-index
          text       = wa_citymayors-city.
      city = wa_citymayors-city.
    * Spaces have to be replaced by _ in the URL
      REPLACE FIRST OCCURRENCE OF space IN city WITH '_'.
    <b>  CONCATENATE
        'http://de.wikipedia.org/wiki/Spezial:Export/' city
           INTO url.</b>
    ****Create the HTTP client
      TRY.
    <b>      CALL METHOD cl_http_client=>create_by_url
            EXPORTING
              url    = url
            IMPORTING
              client = client
            EXCEPTIONS
              OTHERS = 1.</b>
          client->send( ).
          client->receive( ).
          xml = client->response->get_data( ).
          client->close( ).
        CATCH cx_root.
          WRITE: / 'HTTP Connection error: ', city.
      ENDTRY.
    * Wikipedia does not provide a encoding with the returned XML
    * so we have to do the conversion manually
      TRY.
          CALL METHOD cl_abap_conv_in_ce=>create
            EXPORTING
              encoding = 'UTF-8'
              input    = xml
              endian   = 'L'
            RECEIVING
              conv     = l_convin.
          CALL METHOD l_convin->read
            IMPORTING
              data = c_xml.
        CATCH cx_root.
          WRITE: / 'Problem during Character conversion: ', city.
      ENDTRY.
    ****Transform XML to ABAP Values
      TRY.
          CALL TRANSFORMATION zwikipedia_mayor_to_abap
          SOURCE XML c_xml
          RESULT mayor = mayor.
        CATCH cx_root.
          WRITE: / 'Data loss during transformation: ', city.
      ENDTRY.
    * Some Mayors already have pecial Pages
      REPLACE FIRST OCCURRENCE OF '[[' IN mayor WITH ''.
      REPLACE FIRST OCCURRENCE OF ']]' IN mayor WITH ''.
    * Some Mayors are members of a Party
      SPLIT mayor AT '(' INTO mayor trash.
      wa_citymayors-mayor = mayor.
      WRITE: / wa_citymayors-city.
    * Update Database
      IF NOT wa_citymayors-mayor IS INITIAL.
        UPDATE zcitymayors FROM wa_citymayors.
        WRITE: wa_citymayors-mayor.
      ENDIF.
    ENDLOOP.
    Look at the below thread for more info:-
    /people/gregor.wolf3/blog/2006/06/29/use-data-from-wikipedia
    Regards
    Sudheer

  • Calling BSP from abap program by interfacing EP

    Dear Friends...
    I am cslling a BSP... from an ABAP program... for that I have used this class and also a function module to ckeck.. actually from the abap program it invoks the BSP page very nicely and as my logic for invoking the BSP is a part of the Business Object and it is associated with the Enterprise portal so... when i reach the ep and trigger that business object to instantiate the BSP page from my calling logic of abap... it goes to the ITS and port 80 or something and didnt produce the BSP.. and only the blank screen was there...kindly help me how i am supposed to instantiate the BSP from properly from ABAP by interfacing the EP... my code is given below...
    data :
    lv_url type string.
    concatenate
    'http://sapdevbp.sbic.co.za:8041/sap(bD1lbiZjPTIwMA==)'
    '/bc/bsp/sap/z_updatemng/bp.htm?bpid=' object-key-businesspartnerid
    into lv_url.
    call method cl_gui_frontend_services=>execute
    exporting
    document = lv_url
    exceptions
    others = 1.
    please help....
    me...
    regards
    Naim

    hi ,
    you can try using FM CALL_BROWSER in your report(ABAP code)to call bsp,like
    data url(200) type c.
    url = 'http://<server>.<domain><port>:'.
    concatenate url '/sap/bc/bsp/sap/' into url.
    concatenate url 'your_bsp_app_name/your_start_page.bsp' into url.
    concatenate url '?sap-user=<userid>' into url.
    concatenate url '&sap-password=<passowrd>' into url.
    CALL FUNCTION 'CALL_BROWSER'
      EXPORTING
        URL                          = url
       WINDOW_NAME                  = ' '
       NEW_WINDOW                   = ' '
       BROWSER_TYPE                 =
       CONTEXTSTRING                =
    EXCEPTIONS
       FRONTEND_NOT_SUPPORTED       = 1
       FRONTEND_ERROR               = 2
       PROG_NOT_FOUND               = 3
       NO_BATCH                     = 4
       UNSPECIFIED_ERROR            = 5
       OTHERS                       = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    For this to work you have to enable SSO on your server.
    you can check if it is enabled or not by runnning the BSP application "SYSTEM" ,page "SSO2TEST.htm" .
    Follow the instructions on the page for testing.
    This may not be a great way as your userid password are passed via URL,still it works
    Cheers!

  • Call Screen from Standard program

    How to Call a screen of a Z Program from an exit in a standard online program...???
    Thak's
    Flavio Rasseli

    Hi.
    I create dialog modules via SE35 to Call a screen of a Z Program from an exit in a standard online program.
    In the standard:
    CALL DIALOG 'ZTEST2'
         EXPORTING
              act_new FROM 'X'.
    But the screen is shown in "full screen".
    <b>How to show screen with the definition of the position?</b>
    Example:
    ...STARTING AT 2 2
       ENDING   AT  60 09.
    Thank's
    Douglas Sant'Ana

  • Calling LSMW from a program

    Hi,
    Is it possible to call an LSMW from a z program?
    Thanks.

    Hi,
          LSMW  is done seperately with its
    Project
    Subproject and
    Object name ,  u can call it  using  call transaction lsmw onlu
    reward poitns if helpful

  • How to store Connection object and call it from other programs.

    Hi,
    I am trying to connect to the database, store the connection object and use this connection object from other standalone java programs.
    Can any one tell me how to do this? I've tried in the following way:
    In the following program I am connecting to the database and saving the connection object in a variable.
    public class GetKT2Connection {
       public static void main(String[] args) {
          String url = "jdbc:odbc:SQLDsn;
          String dbUser = "sa";
          String dbPwd = "sa";
          Connection kt2conn = Connection connection = java.sql.DriverManager.getConnection(url, dbUser, dbPwd);
          if(kt2conn == null) {
             System.out.println("Database Connection Failure!");
          else {
             System.out.println("Connected to Database...");
         GetKTConnectionObj.storeKT2ConnectionObj(kt2conn);
    } Here is the program to save connection object in a variable.
    public class GetKTConnectionObj {
       static Connection kt2Connection = null;
       public static void storeKT2ConnectionObj(Connection conn) {
       kt2Connection = conn;
       public static Connection getKT2ConnectionObj() {
       try {
          return kt2Connection;
       catch(Exception e){
          System.out.println(e);
      return null;
    }Now from the following code I am trying to get the connection object that is stored. But this is throwing NullPointerException.
    public class Metrics_Migration {
      public static void main(String args[]) {
         try {
        java.sql.Connection connection_1 =   GetKTConnectionObj.getKT6ConnectionObj();
         catch(Exception e){
    }

    kt2Connection is null. You need to store it first, to make it not null. Otherwise it will stay null forever. And why on earth are you trying to do this THIS way?
    If you are running the two applications separately, it wont work either.

  • Error while calling FM from report program

    i am calling a FM using the follwoing program
    REPORT  ZTEST3.
    DATA : EMPNO TYPE zempdata-EMPLOYEE_NUMBER,
          EMPNAME TYPE zempdata-EMPLOYEE_NAME,
          EMPSAL TYPE zempdata-EMPLOYEE_SALARY.
    call function 'ZEMPMASTER'
        EXPORTING
          EMPNO        =  '22609'.
          EMPNAME      =  'vishal'.
          EMPSAL      =  200.
    but when i execute this program i am getting the following error
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYN_CALL_PARAM_MISSING', was
    not caught and
    therefore caused a runtime error.
    The reason for the exception is:
    When calling the function module "ZEMPMASTER", one of the parameters
    needed according to the interface description was not specified.
    This parameter was "EMPNAME".
    i don't know why i am geteing this error where as in my FM ZEMPMASTER i have given only three input parameters
    EMPNO, EMPNAME AND EMPSAL.
    my FM code is like as follows
    FUNCTION ZEMPMASTER.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(EMPNO) TYPE  ZEMPDATA-EMPLOYEE_NUMBER
    *"     REFERENCE(EMPNAME) TYPE  ZEMPDATA-EMPLOYEE_NAME
    *"     REFERENCE(EMPSAL) TYPE  ZEMPDATA-EMPLOYEE_SALARY
    TABLES ZEMPDATA.
    BREAK-POINT.
    data WA_zempdata type zempdata.
    WA_zempdata-EMPLOYEE_NUMBER = EMPNO.
    WA_zempdata-EMPLOYEE_NAME = EMPNAME.
    WA_zempdata-EMPLOYEE_SALARY = EMPSAL.
    BREAK-POINT.
      insert into zempdata values wa_zempdata.
    WRITE :/  wa_zempdata-employee_number,  wa_zempdata-employee_name.
    commit work.
    ENDFUNCTION.
    pls let me know why i am getting this error

    Hi vishal,
    call function 'ZEMPMASTER'
    EXPORTING
    EMPNO = '22609'.<------- Remove this period
    EMPNAME = 'vishal'.<------remove this period
    EMPSAL = 200.<-----------*retain this period*
    We must never change the format in which a FM is displayed once we call the pattern.
    The period will be automatically be available at the end of the FM.need not keep it at end of every line.
    Hope this helps.If problem still persists post back.
    Regards,
    K.Sibi

  • Call winhelp from ABAP programs

    Hi,
    I'm trying to display a windows help file in my ABAP application.
    The idea: by pressing the info-button it should display the file "Info.chm".
    I can display the file, if it is placed locally on the client machine, but I
    want to store it in the system somehow, so that it is available to all of the
    users.
    How can I place it in some repository, and later call the HtmlHelp Application?
    I saw an old example calling
    CALL FUNCTION 'WIN_HELP' FROM 'SAP_GUI'
    but it doesn't work anymore.
    Best regards,
    Stanimir

    Brad,
    I created the object in the SAP Web repository, transaction SMW0.  These are the attributes of the object.
    Z_SAP_HELP     fileextension     .chm
    Z_SAP_HELP     filename     C:\Temp\SAP_help.chm
    Z_SAP_HELP     filesize     28686
    Z_SAP_HELP     mimetype     chm
    Z_SAP_HELP     version          00001
    I created a new Mine type: chm  with extension  *.chm
    I associated %SystemRoot%\hh.exe as the editor for Mime type chm.
    This worked fine for me, but my colleague was unable to successfully run SHOW_WEB_OBJECT until he also set up the editor associated with Mime type chm.  Is there a way to systemically set up the association between a mime type and the editor so that each person does not have to go through this process?
    Thanks
    Bruce

  • Call variant from ABAP program

    Hi all,
    The users have created a variant that they use when they run their report.  When they select the variant it works fine, but they want the program to run the variant for them.  Can anyone give me some ideas as to where I can go to see some sample code, so I can try to figure out how to do this, please?
    Thanks

    Hi,
    you can use function module below to get the values for the variant user has created
    AT SELECTION-SCREEN OUTPUT. 
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
          EXPORTING
            report               = Report Name
            variant              = Variant name
          TABLES
            valutab              = it_valutab
          EXCEPTIONS
            variant_non_existent = 1
            variant_obsolete     = 2
            OTHERS               = 3.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Then LOOP AT IT_VALUTAB INTO WA_VALUTAB WHERE SELNAME = 'YOUR FIRST SELECT OPTION NAME such as S_VBELN'.
               MOVE WA_VALUTAB-SIGN,WA_VALUTAB-OPTION, WA_VALUTAB-LOW, WA_VALUTAB-HIGH to the corresponding fields of your select option i.e. S_VBELN.
        APPEND S_VBLEN.
       ENDLOOP.
    Similarly Loop at IT_VALUTAB for the remaining fields on the selection screen and append the values in the select options.
    Please award points if it solves your problem.
    Cheers
    sharmistha

Maybe you are looking for