Please provide a SD related report

Please provide a complete programming example of SD report that uses the following:
1. ALVs
2. No TABLES statement
3. No JOINS in Select statement. Instead of this, it can contain FOR ALL ENTRIES

Hi,
The code:
report ztest.
type-pools: slis.
tables: vbak, vbpa, serpsls_blockeddoc.
data: lrt_fieldcat type slis_t_fieldcat_alv,
      lrs_fieldcat like line of lrt_fieldcat,
      lrs_layout type slis_layout_alv,
      lrv_status type slis_formname value 'SET_STATUS',
      lrv_user_command type slis_formname value 'USER_COMMAND',
      lrv_repid like sy-repid value sy-repid.
data: lrs_doc type serpsls_blockeddoc,
      lrt_doc type terpsls_blockeddoc.
selection-screen begin of block docdata with frame title text-doc.
  select-options: strvog for serpsls_blockeddoc-trvog,
                  sauart for serpsls_blockeddoc-auart,
                  skunnr for serpsls_blockeddoc-kunnr,
                  serdat for serpsls_blockeddoc-erdat.
selection-screen end of block docdata.
selection-screen begin of block partnerdata with frame title text-par.
  parameters: pzpavw like serpsls_blockeddoc-zpavw.
  select-options: szpers for serpsls_blockeddoc-zpers matchcode object prem,
                  sernam for serpsls_blockeddoc-ernam.
selection-screen end of block partnerdata.
selection-screen begin of block orgdata with frame title text-org.
  select-options: svkorg for serpsls_blockeddoc-vkorg memory id vko,
                  svtweg for serpsls_blockeddoc-vtweg memory id vtw,
                  sspart for serpsls_blockeddoc-spart memory id spa,
                  svkbur for serpsls_blockeddoc-vkbur memory id vkb,
                  svkgrp for serpsls_blockeddoc-vkgrp memory id vkg.
selection-screen end of block orgdata.
selection-screen begin of block adddata with frame title text-add.
  select-options: sfaksk for serpsls_blockeddoc-faksk.
  selection-screen skip.
  parameters: popen radiobutton group 1,
              pall  radiobutton group 1.
selection-screen end of block adddata.
start-of-selection.
  perform data_selection.
  if lrt_doc[] is initial.
    message s490(vr).
    exit.
  endif.
end-of-selection.
  perform fill_fieldcatalog.
  perform build_layout.
  perform reuse_alv_list_display.
form routines
form data_selection.
  data: lf_opendoc type char1.
  if popen is not initial.
    lf_opendoc = 'X'.
  endif.
  call function 'ERPSLS_BILLBLOCKDOC'
    exporting
      it_rg_trvog  = strvog[]
      it_rg_auart  = sauart[]
      it_rg_kunnr  = skunnr[]
      it_rg_erdat  = serdat[]
      iv_zpavw     = pzpavw
      it_rg_zpers  = szpers[]
      it_rg_ernam  = sernam[]
      it_rg_vkorg  = svkorg[]
      it_rg_vtweg  = svtweg[]
      it_rg_spart  = sspart[]
      it_rg_vkbur  = svkbur[]
      it_rg_vkgrp  = svkgrp[]
      it_rg_faksk  = sfaksk[]
      if_opendoc   = lf_opendoc
    importing
      et_doc       = lrt_doc.
endform.
form set_status using extab type slis_t_extab.
  delete extab where fcode = '&AVE'.
  delete extab where fcode = '&OAD'.
  delete extab where fcode = '&ERW'.
  set pf-status 'STATUS_DOCLIST_1' excluding extab.
endform.
form user_command using r_ucomm like sy-ucomm
                        rs_selfield type slis_selfield.
  case r_ucomm.
    when  'DISPLAY'.
      check rs_selfield-tabindex > 0.
      read table lrt_doc into lrs_doc index rs_selfield-tabindex.
      call function 'RV_CALL_DISPLAY_TRANSACTION'
        exporting
          vbeln = lrs_doc-vbeln.
    when  'CHANGE'.
      check rs_selfield-tabindex > 0.
      read table lrt_doc into lrs_doc index rs_selfield-tabindex.
      call function 'RV_CALL_CHANGE_TRANSACTION'
        exporting
          vbeln = lrs_doc-vbeln.
  endcase.
endform.
form fill_fieldcatalog.
  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
         i_structure_name = 'SERPSLS_BLOCKEDDOC'
    changing
         ct_fieldcat      = lrt_fieldcat.
  delete lrt_fieldcat where fieldname = 'LIFSK'.
  delete lrt_fieldcat where fieldname = 'LIFSKT'.
  delete lrt_fieldcat where fieldname = 'AWAHR'.
  read table lrt_fieldcat
       into lrs_fieldcat
       with key fieldname = 'KS'.
  if sy-subrc = 0.
    lrs_fieldcat-seltext_s = text-kss.
    lrs_fieldcat-seltext_m = text-ksm.
    lrs_fieldcat-seltext_l = text-ksl.
    modify lrt_fieldcat from lrs_fieldcat index sy-tabix.
  endif.
  read table lrt_fieldcat
       into lrs_fieldcat
       with key fieldname = 'PS'.
  if sy-subrc = 0.
    lrs_fieldcat-seltext_s = text-pss.
    lrs_fieldcat-seltext_m = text-psm.
    lrs_fieldcat-seltext_l = text-psl.
    modify lrt_fieldcat from lrs_fieldcat index sy-tabix.
  endif.
  read table lrt_fieldcat
       into lrs_fieldcat
       with key fieldname = 'AS'.
  if sy-subrc = 0.
    lrs_fieldcat-seltext_s = text-***.
    lrs_fieldcat-seltext_m = text-asm.
    lrs_fieldcat-seltext_l = text-asl.
    modify lrt_fieldcat from lrs_fieldcat index sy-tabix.
  endif.
  read table lrt_fieldcat
       into lrs_fieldcat
       with key fieldname = 'KR'.
  if sy-subrc = 0.
    lrs_fieldcat-seltext_s = text-krs.
    lrs_fieldcat-seltext_m = text-krm.
    lrs_fieldcat-seltext_l = text-krl.
    modify lrt_fieldcat from lrs_fieldcat index sy-tabix.
  endif.
endform.
form build_layout.
  lrs_layout-colwidth_optimize = 'X'.
  lrs_layout-detail_initial_lines = 'X'.
endform.
form reuse_alv_list_display.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program        = lrv_repid
      i_callback_pf_status_set  = lrv_status
      i_callback_user_command   = lrv_user_command
      is_layout                 = lrs_layout
      it_fieldcat               = lrt_fieldcat
      i_save                    = 'A'
    tables
      t_outtab                  = lrt_doc
    exceptions
      program_error             = 1
      others                    = 2.
endform.
Inside the report they use function module ERPSLS_BILLBLOCKDOC which contains for all entries too.
Pls reward points if useful
Regards,
Renjith Michael.

Similar Messages

  • Please provide me the related documents...

    Hi,
    Please provide me the documents or links related to the following:
    GL setup and conversions,
    Reporting requirements ,
    To implement the Global template related to GL,
    Tracking the company codes and the configuration,
    Transports and testing and documentation.
    I'll be highly thankful to you.
    Regards,
    Divya

    creating g/l account
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/59/0735b412c311d396cb006094b969cf/frameset.htm
    read all related links
    reporting requirements- not clear by what you mean,
    you can create a report using report painter( GRR1) query( SQ01) or ABAP
    there are many standard reports which you can search in the information system
    company code
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/8e/1a5217171311d28e1d080009b6ab29/frameset.htm
    transports - send me a test email and i will forward u a document
    like Ashok said everything is available on help.sap.com
    Points will be appreciated
    Regards,
    Zaid Azam

  • Please provide user exits related to billing in NP10 transaction

    Hi All,
    My requirement is that after entering in np10 transaction, after giving institution and case and choose display it wil take you to case overview list , select one of the case list and click on invoice  and choose cancel tab button then  in cancel  date
    the system date has to be populated ,as the it is a production issue.
    Regards
    subba

    Subba,
    you might want to review the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], especially paragraph Step1 as well as item 1 of this paragraph
    - Why is Nobody Answering my Question?
    There may be a variety of reasons:
    1) Never assume that you are entitled to an answer. Remember: this is a community forum; people have jobs just like you and respond voluntarily. Perhaps nobody knows the answer.
    2) Did you give the other users enough time? Don't be impatient. If the question is u.rgent, go to the official service channels.
    3) Is your subject misleading? your post in the right forum? your problem description understandable?
    In short, this is a voluntary forum and no official maintenance or consulting channel.
    anton

  • Please provide me all the t codes related to direct invoices , SRM...

    Hi All,
    Please provide me all the t codes related to direct invoices , SRM and Manual Purchase orders
    Thanx in advance,
    Ravi.

    Dear Ravi,
    use Transaction Se16 and write the table name as TSTC what you will get is a list of all T-codes with there description.
    Another method is using the Transaction-SDMO here you enter the text and you will get all transactions related to the text you enter.
    Using these two transactions I hope you would be able to find out all the t-codes.
    Cheers,
    Prafulla
    Message was edited by:
            prafulla singh

  • Hi guys please provide me the concepts on workflow

    hi guys,
    please provide me the concepts on workflow.
    i have no idea on workflow,
    if you have any helpfull documentation and also some scenarios where u have faced and solved those,also some real time examples.
    please help me, and also i will give points if it is helpfull.
    thanks.
    prasadnn.

    Hi Prasad
    Please find some questions related to WorkFlow
    1. Is there a good book about this subject?
    Yes, "Practical Workflow for SAP" by Rickayzen, Dart, Brennecke and Schneider. Available from SAP press at the end of July. A german translation of this workflow book is also available directly from Galileo-Press, the publisher.
    2. How do I convince my company to use workflow?
    Feedback from user groups emphasizes that although the competitive advantage gained by using workflow eclipses the financial savings, it is the financial savings that are the deciding factor when obtaining support from senior management. Projects getting the blessing at the CEO level are much easier to manage, and far more likely to reach their goal within the project time frame. So plan well, and don't neglect the business case.
    Because the following questions deal with the financial case in more detail, this section will finish by listing the competitive advantages.
    The quality of the process is assured by pushing the relevant information together with links to related transactions directly to the user. Managers don't have the time to search for information so give them what they need to reach the correct decision.
    Cycle time is reduced by pushing the process directly to the users. The users receive notification of a task immediately and can even be prioritized by the system.
    The tasks are performed consistently and diligently by the users. The workflow system pushes all the necessary information needed to perform a task, including a clear description of what has to be done, how to do it and the impact this task has on the business process for your company. At any time, the user can check the list of tasks pending and determine at a glance which are the important tasks, and which tasks can be completed the next day without any negative impact.
    The process instance is transparent. Any user can check at any time how far the process has progressed and which stage the process has reached. For example the call center can immediately see the status of a purchase order, an employee requisitioning a purchase would see at a glance if a colleague has been sitting on it for too long, the ad hoc notes made when approving an engineering change request are visible long after the request has gone into production.
    The process is flexible, allowing it to be changed on the fly without retraining everyone involved. The description accompanying the change takes care of on-the-fly process improvements.
    Deadline handing ensures that users perform the tasks within the time planned. Escalation measures ensure that the failure to meet a deadline can be corrected by other means.
    Intelligent reporting highlights the weaknesses of a process. Often there is a simple cure to such weaknesses such as reeducating the users involved in the bottleneck or providing additional information (automatically). The difficulty of a non-automated process is identifying such bottlenecks.
    The process definition is transparent. You can see at a glance how the process works and who will be selected to perform the different tasks. Think of the workflow as the process book. If you can spot the pattern and define the process without headaches, you can create a workflow definition effortlessly. However, don't forget that if a company has business processes that are erratic and lack a consistent pattern, the company is very likely to be losing a lot of money in terms of lost contracts, labor intensive administration and low customer confidence. It is my personal opinion that automating exactly this type of processes will yield the best returns, but only if you limit yourself to automating the basic skeleton of the process first. Don't get bogged down in the detailed exception handling. That can be done in the next phase once you've checked the process statistics and determined which exceptions are worth tackling.
    As with most software the reasons for automating business processes are primarily to increase the competitive edge of your company and to cut costs. Although the increase in competitively gained by radically reducing process times is by far the most insignificant gain from workflow, you should not ignore the cost savings. The cost saving calculations are needed by upper management in order to approve workflow projects. This upper management signature will be very useful in different phases of the project and cannot be underestimated.
    3. How do I calculate the cost saved by workflow?
    Calculate the cost of the manual process in terms of man hours. Don't neglect the time spent gathering information. Ask the following questions:
    Is the user forced to log into different systems, or scan through printed documentation....?
    Does a skilled user spend time on parts of a task, where less skilled (less expensive) user could do the groundwork? I.e. Can a single task be split into skilled and unskilled tasks to free the skilled worker for work where his/her skills are really needed?
    Is time spent researching the progress of a process (usually done by someone not involved in the process directly)?
    Is time spent determining who to give the task to next?
    Probably the most significant cost will the be the cost of failure?
    How often does the process fail?
    What is the real cost of failure? Loss of a contract? Loss of a customer? Law suit?
    If the failure can be rectified, how labor intensive is it?
    4. What are typical costs saved by workflow?
    A manually processed accounts payable invoice will cost about 25 USD. After workflow enabling about 15 USD (one example based on customer feedback from a user group meeting).
    5. What are typical reductions in processing time caused by workflow?
    A traditional paper based approval process involving three people will typically take seven days to complete. The automated process will take one day (results based on customer feedback).
    6. What do customers say are the strengths of SAP WebFlow?
    WebFlow is the internet functionality of SAP Business Workflow. Based on customer feedback from the various regional users groups, the main strengths of SAP Business Workflow are:
    Robust production workflow system, (upgrade continuity with the rest of the SAP system, versioning, scalability, no gluing....)
    Standard workflow templates delivered by SAP can be used out-of-the-box or tweaked to deliver the optimum business process for your company. Workflows can be up and running including training in under a day (thanks to the knowledgeware delivered as part of the template packet).
    Seamlessly integrated into the SAP environment, be it R/3, Business to Business Procurement, CRM, APO, mySAP.com.... Examples of integration are:
    Business Reporting (WIS),
    Context sensitive availability at any time through the system menu (available anytime, anywhere)
    More and more standard SAP functionality is being provided by using SAP Business Workflow so your homegrown workflows fit the landscape exactly,
    More and more workflow functionality is available directly within the SAP transaction or Web MiniApp.
    WebFlow is becoming more and more important because companies are no longer being judged by their own performance but by the combined performance of the company AND its partners. In other words it is not enough that the business processes within your company run smoothly and faster than your competitors. You have to ensure that the processes between you and your partners are also as fast, efficient and flexible as possible. WebFlow delivers this.
    7. How are users notified about their work pending?
    The users are informed by a work item which you may think of as being very like an e-mail. The difference is the work item contains intelligence and by executing the work item you will be taken to the form or SAP transaction that makes up the step in the workflow. This form or transaction could be a decision, a request for information or a request for confirmation that a particular task has been performed.
    The work item is usually accompanied by a description of what has to be done, where to refer to when assistance is needed (help desk, intranet...) and a summary of information about the business object or process which enables the operator to attack the task immediately.
    This work item can be received and executed in MS OutlookÒ, Lotus NotesÒ, mySAP Workflow MiniApp or the SAP integrated inbox. If this is not enough, the workflow system can transmit e-mail notifications directly to any mail system, informing the user of the need to log in to the SAP system to execute the task. The e-mail notification is done on a subscription basis so that users can de-subscribe from this service if they already check their work item inbox regularly.
    8. What workflow reporting is available and is it useful?
    Standard workflow reports exist which allow the administrator to check statistics such as the frequency and average duration of the workflow processes. However the real strength of the workflow reporting is that it allows reports to be configured which analyze the process statistics in combination with the data involved within the workflow process and the organizational units associated with the process. For example you can determine the average time invested in a failed contract renewal request, the time taken to create material masters in different plants or the frequency of rejected purchase requisitions on a department to department basis. Often, big reducations in cost or cycle time can be obtained without touching the workflow definitions. Reeducating a particular group of users or incorporating supplementary information in a work item description can often cause dramatic improvements on the cycle times of particularly critical subsets of the process. It is not unusual that this may have a big impact on specific products, plants or organizational units. This will show up in the WebFlow reporting in LIS or the Business Warehouse but it might not show up in traditional statistical workflow reporting. Even though the average time does not change significantly, the impact on costs and profit can be dramatic.
    9. How do I choose who to distribute the tasks to?
    A work item is assigned to one or more users. Whoever reserves or executes the task first wins and the work item vanishes from the other users' inboxes. This eliminates the need to assign the user to one single user. I.e. No need for complicated algorithms to determine which single user will receive the work item and no need to worry about what will happen when one user is ill for the week (also taken care of by sophisticated substitution mechanisms which can be linked to the SAP organizational model).
    Tasks can be assigned to an organizational unit but the strength of the workflow system is to enable business rules which select users according to the data being processed. For example, you might have one group of users associated with one quality notification type. The workflow can be configured to query the QM module directly to determine the users. You can define fallbacks using the default role associated with a task and allow agents to be specified on the fly by a supervisor.
    Tasks can be assigned to office distribution lists which is useful when you want your users to subscribe or unsubscribe to a particular task. A typical use of this would be where you have a work rote or want to reduce user maintenance to an absolute minimum. The users subscribe or unsubscribe by joining or leaving an office distribution list (one mouse click).
    10. What happens when a deadline is missed?
    This depends on your workflow definition. In the simplest case an e-mail is sent to another user by the system (typically your supervisor so watch out!). However in more sophisticated scenarios a missed deadline can redirect that path that the workflow takes. One customer uses deadlines to automatically make an approval if the deadline is missed (at about the eighth approval level!!!). This gives the user the chance to make rejections but does not force him/her to go into the system to approve the other 99.9% of the requests. In safety critical environments the workflow might trigger off preventative action when a deadline is missed or might put other processes on hold. There is no limit as to how you can use this functionality.
    11. What deadlines can be monitored?
    Many different types of deadlines can monitored. At the single workflow step level you can define deadlines which trigger when the work item has not completed within a certain time and other deadlines when no one starts working on the work item within a given time. You can specify the task deadline statically (e.g. 1 week) or dynamically (e.g. 1 week for material type A and 2 weeks for all the other materials). The offset can be related to the step (e.g. you have 1 week to complete this step) or related to the process (e.g. complete within 2 weeks of the complete process starting, irrespective of how long your colleagues have hogged the previous steps).
    Last but not least, deadlines can be set for sub-processes, which is often more important than the deadline of a single step in a workflow.
    12. How can I check the status of a workflow?
    This is one of the very cool features of SAP Business Workflow. You can usually navigate directly from the business object to check the workflow progress. For example, while viewing a purchase order you can select "workflow" from the system menu or toolbar and you will see a list of workflows related to the purchase order. Usually just one, but if you have created a few of your own and these have been triggered you will see the status of these too. And that is not all. You also see a simplified summary of all the steps that have taken place so far including who performed them, when they were executed and which ad hoc notes were attached.
    13. How are workflows triggered?
    Workflows can be triggered automatically by changes in the system or manually by an operator. Manually triggered workflows are good for processes that remedy a problem the operator has noticed or for dealing with a forms-based requests (E.g. my PC won't boot). Automatically triggered workflows are useful because the operator does not even have to be aware of the workflow's existence to trigger it. In addition to triggers embedded in transactions there are also generic triggering mechanisms such as a change in the status of a business object or a change in the HR data. Irrespective of how the workflow is triggered, it is linked to the business object as described in the previous answer and can be tracked easily. Because WebFlow is part of the basis system, this triggering is reliable and easy to implement.
    Workflows may be triggered by events but this is not essential. The event-handling makes it easy to trigger workflows from transactions and system changes without you having to make modifications. If you are creating your own report or transaction which triggers a workflow, avoid events and trigger the workflow directly with the WAPI function call. This is particularly important when triggering a workflow from outside the SAP system. This method reduces flexibility (the workflow ID is hard-coded) but increases performance if this is an issue (we're talking about 50 000 work items a day here!).
    Any exception handling workflows that are intended to be triggered manually can be triggered from the system menu when viewing the relevant transaction. The SAP system has the intelligence to suggest workflows that can be triggered manually based on the authorization of the operator and the context that the operator is working in. No additional customizing is needed here.
    14. What open interfaces are supported?
    The most significant interface supported is the Wf-XML standard from the Workflow Management Coalition. This is an independent organization of which SAP is a funding member, along with most other major workflow vendors. The Wf-XML interface is based on XML and allows workflows from different vendors to communicate with each other. A detailed description of the interface is available on the WfMCs web site at www.wfmc.org.
    15. What is Wf-XML used for?
    Although a company is far better off workflow enabling their system with SAP WebFlow when SAP software is used anywhere within the process, a collaborative process can take place between partners using different software platforms employing different workflow systems. To support SAP customers in this situation, WebFlow offers the open interface Wf-XML. This allows Business Processes enabled using different tools to communicate and control each other. Any workflow tool offering this interface can connect up with other tools that also offer this interface.
    Wf-XML is the only open interface for supporting interoperability of business processes, independent of what the business process being integrated.
    16. Where does Wf-XML come from?
    Wf-XML comes from the Workflow Management Coalition, an independent body of workflow vendors, customers and higher education establishments.
    17. How does the workflow call procedures from non-SAP systems?
    The Actional control broker integrates directly into SAP WebFlow enabling proxy objects to be called directly from the workflow step. When called, the proxy method will make a call to the outside system either as a background task or as a dialogue step. These proxy objects are generated in the SAP system using a converter which converts the objects interface (DCOM, CORBA...) to the SAP syntax. A syntax converter also lets developers view any object in any of the participating systems in the developer's preferred language.
    18. How can I get the workflow initiator information in my task?
    1) From your triggering event to the workflow, bind the event creator element to the workflow initiator element.
    2) Create a workflow container element based on USR01.
    3) Add a step based on USR01.FINDUSERFROMAGENTSTRUCTURE to convert your initiator to a USR01 object.
    4) Pass the USR01 object to each task you want to display the details.
    Mailing
    19. What differences are there between a work item and a notification mail?
    a) The work item cannot be used to notify several users.
    Mails can be routed to several users, just like work items. When a mail is sent, and one recipient reads and deletes the mail, all other recipients will still have access to their own copy in their own inbox. However, when a work item is processed by one of the recipients it will automatically disappear from all the other inboxes. So you can see that a work item is unsuitable for notifying several users.
    It is also worth noting that a mail can be forwarded in many different ways (fax, internet...) whereas the work item cannot.
    b) The work item holds up the workflow
    When the workflow sends a mail (usually as a background step) it continues with the process immediately after transmitting the mail. When a work item is generated, the workflow will not continue until the work item has been processed. This slows down the process. Occasionally this is what is intended (using the work item as an approval step without the ability to reject) but usually you will better off using mails for notifications.
    Note: You can send business objects as references with the mail either as a business object reference attached to the mail or as an URL (ABAP required).
    What is the difference between sending a mail to a recipient list compared to sending individual mails via a dynamic loop?
    Performance. Sending 1 mail to 20 recipients will cost considerably less performance than sending 20 individual mails. If the mail is sent as a SAP Office mail (as opposed to e-mail, fax...) disk space will also be a factor because the SAP office mail will only exist once in the database, with references being created for each of the recipients.
    The only time you need to consider individual mails with a dynamic loop is when the text of the mail varies from one recipient to another.
    20. How do I send a standard text as an e-mail from workflow?
    It is very easy sending standard text , which may include data from the workflow. You simply create a background step which sends the work item description. This may include variables which will be substituted when mail is sent.
    In early releases you have to create your own task based on the method SELFITEM SendTaskDescription. In later releases a wizard is available for creating the step and in release 4.6 there is even a step type which does this all for you automatically.
    Whichever path you take, there is very good online documentation describing exactly what has to be done.
    21. How do I send a complex text from the workflow?
    You may create mails using SAPscript. These mails can include conditions which are evaluated in order to determine which text blocks which are used in the mail. Workflow variables can be used in these conditions and workflow variables can be substituted into the body of the e-mail text.
    22. How do I send really complex mails from the workflow?
    If you this is not enough for you will probably want to write your own ABAP routines for generating the text and generating the attachments to go with the text.
    Use the function group SO01 which contains functions of the form SO_*_API1 which are ideal for creating your own sophisticated messages. There are plenty of advantages of how these are used within the SAP system.
    23. How do I send reports?
    There are wizards (Release 3.1) which will create workflows for you to send reports to a distribution list. You can specify whether the results should be transmitted or evaluated at the time the recipient wishes to view the report. It is usually better to send the evaluation because this allows the recipient to see the results instantaneously, without having to wait for the report to execute first.
    Deadlines
    24. How can I configure the workflow so that different types of messages are sent out to different people depending on how late the processing is?
    Follow these steps:
    1. Specify a deadline period for the step.
    2. Specify a name for the event. This adds new branch from the step.
    3. Add a new step to the branch which sends a mail message.
    4. Add another step to the branch which sends out the second deadline warning (see mail steps above). Use deadlines in this step to configure an earliest start so that the second message is not sent until a further time has elapsed.
    5. Repeat step 5 as often as you like.
    25. How can I configure the workflow so that when the deadline is missed the workflow step is simply skipped?
    This is tricky to explain but easy to implement once you know how.
    Follow these steps (in later releases there is a wizard which takes you through the steps):
    1. In the terminating events view of the workflow step activate the "obsolete" event and give it a name.
    2. Specify a deadline period for the step.
    3. Specify a name for the event. This adds new branch from the step.
    4. Add a new step to the deadline path. This step must be of type "process control".
    5. Select the control "Make step obsolete" and use the search help to specify the workflow step that has the deadline. Only steps with obsolete paths defined will be displayed (see step 1).
    26. How do I trigger a workflow with an e-mail?
    You can customize the system to call a BOR method when an external mail (fax, e-mail...) arrives in the system. You BOR method should either trigger the e-mail directly or trigger an event. To customize this user exit use the transaction SCOT.
    27. How can I make sure that user's access their tasks via the workflow and not via the menu or launch pad?
    The routing mechanism for work items uses roles and organizational assignments to determine who receives which work item. However the routing does not provide extra authorization checks based on the routing configuration. If you want to ensure that the tasks are executed within the workflow, and not via the standard transaction, service or MiniApp, then you will have to apply your own protection.
    The simplest way of doing this is to remove the standard transaction from the user's menu or Workplace role (but include it in the supervisor's role, just in case).
    If you want to allow the user to execute the task from the menu if and only if they have received the work item then you should replace the standard transaction with your own custom built transaction. Your own transaction simply calls the standard transaction but performs it's own authorization check first, based on the routing mechanism used in the workflow. Tip: Add a second (ored) authorization check to make sure that a supervisor can execute the transaction in an emergency.
    28. What is a workflow? What is a single-step task?
    A single-step task is based on an object type from the object business repository (BOR) (for example, a purchase order) and a method for the object (for example, change). A workflow can contain several single-step tasks and activities such as loops and forks. Through a workflow, you create a logical sequence for the single-step tasks. The tool for creating or changing these types of workflows (workflow template) is the Workflow Builder (transaction SWDD).
    29. What is a work item (important terms)?
    A work item is the runtime object of a workflow or of a single-step task.You can execute dialog work items with the inbox (transaction SBWP). Each workflow and single-step task started is assigned a unique number known as the work item ID.
    30. How is an event triggered from the application and a workflow then started?
    An event can be triggered from the application in three different ways:
    Directly:
    Within the application, the SWE_EVENT_CREATE function module or the SWE_EVENT_CREAT_IN_UPD_TASK function module, for example, generates an event in the update.
    With a change document:
    Change documents are written within the application when you change application objects in the update. You can link events that have the same key with these types of change documents via transaction SWEC.
    With status management:
    The SWE_EVENT_CREATE_STATUS function module triggers an event in the same way as the direct method when a status is changed. This event contains the object type (for example, purchase order), the object key (for example, purchase order 4711) and other information. Using transaction PFTC, you can assign the event to a specific workflow or single-step task. More settings are available in transaction SWE2.
    31. How are the responsible agents determined?
    You can assign agents to a single-step task in transaction PFTC. For example, you can do this using organizational units, work center roles or positions. Within a workflow pattern, you can assign specific agents for this workflow to a single-step task. The overlap between both numbers of 'possible agents' represents the number of agents ('selected agents') who have the work item in the inbox later.
    32. What is the difference of between an e-mail and a work item?
    E-mails and work items are two completely separate things. They just happen to be displayed in the same inbox. An e-mail is a message sent to one or several people. However, a work item is a runtime object of a single-step task or workflow. Consequently, a work item cannot be deleted from the inbox of a user. In this case in fact, you have to adjust the agent assignment or delete the work item as described in note 49545.
    33. PFAC no longer works for my role responsibility setup...
    Use tx: OOCU_RESP
    34. How do I transport workflow definitions and agent assignments?
    When transporting workflows, you have to differentiate between the workflow definition and the agent assignment.
    A workflow definition is a workbench request. When you save the workflow, a workflow version is created and a request written. Further information about the transport or about the status management is provided in note 378487 and in the notes mentioned there under related notes.
    However, where the agent assignment is concerned, this is a Customizing request. To allow transport of agent assignments, the value of the semantic abbreviation CORR for the TRSP group name must be empty in table T77S0.
    35. How do you debug a background workflow process?
    In your method write the following code:
    data exit.
    Do.
    if exit = 'X'.
    exit.
    endif.
    enddo.
    Run the workflow, causing an infinite loop on that step, and then go to SM50.
    Here you can debug the process.
    36.What is the Workflow basic Customizing?
    Before you can use the Workflow module, you must first execute the basic Customizing in transaction SWU3. All of the listed points should be green (the number range for customer tasks is no longer required). A detailed description of the activities is provided in the relevant information buttons. You can also execute some (but not all) of the points using the Automatic Customizing button. See the online documentation for an exact description of what happens there. The RFC destination must work correctly and the user (usually WF BATCH) should have the SAP_ALL profile.
    37.: What options do I have as a user to configure the inbox individually?
    You have the following options:
    You can create separate user-dependent or user-independent layouts so that you can adapt the displayed columns individually. You can access the function in the Workplace via an application function key.
    You can set filters to set certain criteria for individual columns or several columns simultaneously, according to which specific work items are then filtered.
    You can add dynamic columns in the layout that then display dynamic elements for certain tasks and users from the work item container. However, this is only possible if all tasks in the inbox belong to just one task. If they have several tasks in the inbox, filtering serves no useful purpose because all tasks are first completely read once. You can define these dynamic columns using transaction SWL1.
    38. What does the substitute rule system look like in the workflow?
    You have a choice of two different substitute rulings:
    Active substitute ruling (for example, for absence due to vacations): In this case, the items belonging to the absent person are automatically assigned to the substitutes inbox (in addition to his own work items).
    Passive substitution (for example, for absence due to illness): the substitute must explicitly assume the substitution and can only view the items of the absent person in this mode.
    For other questions, you must also refer to note 74000.
    39. How can users be automatically notified that new work items are available for processing?
    Unfortunately, the dialog box that informs users of new work items which appears in SAPoffice is not available within SAP Systems.
    However, the following two options are provided:
    In the Workflow Builder, you can designate the item as an express item via additional data. The user then receives a corresponding express dialog box.
    The RSWUWFML report (note 131795) is a more flexible option. This report sends an e-mail to an external Internet address to notify the user of new work items.
    40. Can I set deadlines for the latest processing of work items?
    this is where you can use deadline monitoring for work items. In the Workflow Builder, you can set dates for a requested/latest start/end date for each individual step. You must schedule the SWWDHEX job via transaction SWU3 for this. Schedule the job permanently in the production system otherwise it is difficult for the job to schedule individual deadline monitoring scenarios when workflow is heavy.
    41. Can I also execute work items with external programs such as Outlook?
    You can use the Web GUI for HTML instead of the Windows GUI. However, note that some functions do no work in the WEB GUI, due to technical restrictions in the browser. You must refer to note 487649 on this subject.
    SAP also provides interfaces which allow you to process work items with external programs such as Lotus Notes or Microsoft Outlook. Refer to notes 77099, 98408 and 454845 for details.
    Hi ,
    More stuff on WORKFLOW
    Transactions
    AWUV Wizard for event creation Definition tools -> Event creation -> Set up with wizard
    MCA1 Workflow Information System Reporting -> Workflow Information System (WIS)
    OOAW Evaluation paths
    PFAC Maintain standard roles
    PFAC_CHG Change roles Definition tools -> Standard roles -> Change
    PFAC_DEL Delete roles Definition tools -> Standard roles -> Delete
    PFAC_DIS Display roles Definition tools -> Standard roles -> Display
    PFAC_INS Create roles Definition tools -> Standard roles -> Create
    PFOM Maintain assignment to SAP organizational objects Definition tools -> SAP org. objects -> Create assignments
    PFOS Display assignment to SAP organizational objects Definition tools -> SAP org. objects -> Display assignments
    PFSO Organizational environment of a user
    PFT Maintain customer task
    PFTC General task maintenance
    PFTC_CHG Change tasks Definition tools -> Task/Task groups -> Change
    PFTC_COP Copy tasks Definition tools -> Task/Task groups -> Copy
    PFTC_DEL Delete tasks Definition tools -> Task/Task groups -> Delete
    PFTC_DIS Display tasks Definition tools -> Task/Task groups -> Display
    PFTC_INS Create tasks Definition tools -> Task/Task groups -> Create
    PFTR Standard task for transaction
    PFTS Standard task
    PFWF Maintain workflow task (customer)
    PFWS Maintain workflow template
    PPOC Create organizational plan Definition tools -> Organizational plan -> Create
    PPOM Maintain organizational plan Definition tools -> Organizational plan -> Change
    PPOS Display organizational plan Definition tools -> Organizational plan -> Display
    SWDA Ongoing Settings Administration -> Settings
    SWDC Workflow editor administration data
    SWDM Business Workflow Explorer Definition tools -> Business Workflow Explorer
    SWE2 Display and maintain event type linkage Utilities -> Events -> Type linkages
    SWE3 Display instance linkages Utilities -> Events -> Instance linkages
    SWE4 Switch event log on/off Utilities -> Events -> Event/log -> On/Off
    SWEC Link change documents to events Definition tools -> Event creation -> Change documents -> Linkage
    SWED Assignment of change document objects to object types Definition tools -> Event creation -> Change documents -> Define workflow properties
    SWEL Display event log Utilities -> Events -> Event log -> Display
    SWF3 Workflow Wizard Explorer Definition tools -> Wizards -> Workflow Wizard Explorer
    SWF4 Workflow Wizard Repository Definition tools -> Wizards -> Workflow Wizard Repository
    SWI1 Selection report for workflows Utilities -> Work item selection
    SWI2 Work item analysis Reporting -> Work item analysis
    SWI3 Workflow outbox Runtime tools -> Workflow outbox
    SWI4 Task analysis Reporting -> Task analysis
    SWI5 Workload analysis Reporting -> Workload analysis
    SWI6 Object links Runtime tools -> Object links
    SWI7 Workflow resubmission folder From Integrated Inbox or Workflow Outbox
    SWI8 Error overview Part of administration of workflow runtime system (transaction SWUF)
    SWL1 Settings for dynamic columns Customizing, part of ongoing settings
    SWLC Check tasks for agents Utilities -> Consistency check -> Organizational assignment
    SWLD Workbench for Workflow 4.0
    SWLP Copy plan version
    SWLV Maintain work item views Customizing, part of ongoing settingS
    SWLW Workbench for Workflow 3.0
    SW01 Business Object Builder Definition tools -> Business Object Builder
    SW06 Customizing object types From Business Object Builder, choose Settings -> Delegate -> System-wide
    SWU0 Event simulation Utilities -> Events -> Simulate event
    SWU2 RFC monitor Utilities -> Workflow RFC monitor
    SWU3 Customizing consistency check Utilities -> Customizing
    SWU4 Consistency check for standard tasks Utilities -> Consistency check -> Task -> Standard task
    SWU5 Consistency check for customer tasks Utilities -> Consistency check -> Task -> Customer task
    SWU6 Consistency check for workflow tasks Utilities -> Consistency check -> Task -> Workflow task
    SWU7 Consistency check for workflow templates Utilities -> Consistency check -> Task -> Workflow template
    SWU8 Switch technical trace on/off Utilities -> Technical trace -> On/off
    SWU9 Display technical trace Utilities -> Technical trace -> Display
    SWUD Diagnostic tools Utilities -> Diagnosis
    SWUE Trigger event Utilities -> Events -> Generate event
    SWUF Runtime system administration Administration -> Runtime system
    SWUG Workflow start transactions Definition tools -> Workflow start transactions
    SWUI Start workflows From the R/3 initial screen, choose Office -> Start Workflow
    SWUS Start tasks Runtime tools -> Start workflow
    SWUY Wizard for message linkage to workflow Definition tools -> Wizards -> Create "Call workflow from message"
    SWX1 Create notification of absence
    SWX2 Change notification of absence
    SWX3 Display notification of absence
    SWX4 Approve notification of absence
    SWXF Form applications: Access point Environment -> Demo examples -> Fill out form
    Reports
    RSWWWIDE – Delete work items
    RHSOBJCH to fix PD Control Tables
    Tables
    SWW_OUTBOX - Lists Workflows in outbox together with status
    SWW_CONT - Container Contents for Work Item Data Container
    SWW_CONTOB- Container Cont. for Work Item Data Container (Only Objects)
    SWWLOGHIST- History of a work item
    SWWORGTASK- Assignment of WIs to Org.Units and Tasks
    SWWUSERWI - Current Work Items Assigned to a User
    SWWWIHEAD - Header Table for all Work Item Types
    Reward poits if helpful.
    Regards,
    Amber S

  • Please provide me material for bdc

    Hi everyone,
    can you please provide me some stuff for bdc, actually i am working on bdc for mm01 , so plz send me study materials and if you have any scenario then please forward me.
    Thanks & Regards,
    Vimarsh B.

    Hi
    Hope it will help you.
    Reward if help.
    BATCH DATA COMMUNICATION
    About Data Transfer In R/3 System
    When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
    In the process of replacing current applications and transferring application data, two situations might occur:
    u2022 The first is when application data to be replaced is transferred at once, and only once.
    u2022 The second situation is to transfer data periodically from external systems to SAP and vice versa.
    u2022 There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
    The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called u201Cbatch inputu201D or u201Cbatch data communicationu201D.
    1. SESSION METHOD
    2. CALL TRANSACTION
    3. DIRECT INPUT
    Advantages offered by BATCH INPUT method:
    1. Can process large data volumes in batch.
    2. Can be planned and submitted in the background.
    3. No manual interaction is required when data is transferred.
    4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.
    To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a u201Cdata transferu201D program must map the data from the external system into the data structure required by the SAP batch input program.
    The batch input program must build all of the input to execute the SAP transaction.
    Two main steps are required:
    u2022 To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
    u2022 To pass the table to SAP for processing.
    Prerequisite for Data Transfer Program
    Writing a Data Transfer Program involves following prerequisites:
    Analyzing data from local file
    Analyzing transaction
    Analyzing transaction involves following steps:
    u2022 The transaction code, if you do not already know it.
    u2022 Which fields require input i.e., mandatory.
    u2022 Which fields can you allow to default to standard values.
    u2022 The names, types, and lengths of the fields that are used by a transaction.
    u2022 Screen number and Name of module pool program behind a particular transaction.
    To analyze a transaction::
    u2022 Start the transaction by menu or by entering the transaction code in the command box.
    (You can determine the transaction name by choosing System u2013 Status.)
    u2022 Step through the transaction, entering the data will be required for processing your batch input data.
    u2022 On each screen, note the program name and screen (dynpro) number.
    (dynpro = dyn + pro. Dyn = screen, pro = number)
    u2022 Display these by choosing System u2013 Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
    The technical info pop-up shows not only the field information but also the program and screen.
    u2022 For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
    Note the following information:
    - The field name for batch input, which youu2019ll find in its own box.
    - The length and data type of the field. You can display this information by double clicking on the Data Element field.
    u2022 Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
    Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
    In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
    You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
    Once you have program name, screen number, field name (screen field name), you can start writing.
    DATA TRANSFER program.
    Declaring internal table
    First Integral Table similar to structure like local file.
    Declaring internal table like BDCDATA
    The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
    The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
    This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
    u2022 Create a BDCDATA structure
    u2022 Write the structure out to a session or process it with CALL TRANSACTION USING; and then
    u2022 Create a BDCDATA structure for the next transaction that is to be processed.
    Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
    The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
    u2022 Data that is entered into screen fields.
    u2022 Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
    The BDCDATA structure contains the following fields:
    u2022 PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
    u2022 DYNPRO: Screen Number. Set this field only in the first record for the screen.
    u2022 DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to u2018 u2018 (blank) for all other records.)
    u2022 FNAM: Field Name. The FNAM field is not case-sensitive.
    u2022 FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
    Transferring data from local file to internal table
    Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
    Population of BDCDATA
    For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
    All these five initial steps are necessary for any type of BDC interface.
    DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.
    First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
    SESSION METHOD
    About Session method
    In this method you transfer data from internal table to database table through sessions.
    In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
    Unless session is processed, the data is not transferred to database table.
    BDC_OPEN_GROUP
    You create the session through program by BDC_OPEN_GROUP function.
    Parameters to this function are:
    u2022 User Name: User name
    u2022 Group: Name of the session
    u2022 Lock Date: The date on which you want to process the session.
    u2022 Keep: This parameter is passed as u2018Xu2019 when you want to retain session after
    processing it or u2018 u2018 to delete it after processing.
    BDC_INSERT
    This function creates the session & data is transferred to Session.
    Parameters to this function are:
    u2022 Tcode: Transaction Name
    u2022 Dynprotab: BDC Data
    BDC_CLOSE_GROUP
    This function closes the BDC Group. No Parameters.
    Some additional information for session processing
    When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
    However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.
    If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
    CALL TRANSACTION
    About CALL TRANSACTION
    A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>
    Messages into <MSGTAB>.
    Parameter u2013 1 is transaction code.
    Parameter u2013 2 is name of BDCTAB table.
    Parameter u2013 3 here you are specifying mode in which you execute transaction
    A is all screen mode. All the screen of transaction are displayed.
    N is no screen mode. No screen is displayed when you execute the transaction.
    E is error screen. Only those screens are displayed wherein you have error record.
    Parameter u2013 4 here you are specifying update type by which database table is updated.
    S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
    A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
    Parameter u2013 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:
    1. Tcode: Transaction code
    2. Dyname: Batch point module name
    3. Dynumb: Batch input Dyn number
    4. Msgtyp: Batch input message type (A/E/W/I/S)
    5. Msgspra: Batch input Lang, id of message
    6. Msgid: Message id
    7. MsgvN: Message variables (N = 1 - 4)
    For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).
    Steps for CALL TRANSACTION method
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)
    4. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>.
    Refresh BDCTAB.
    Endloop.
    (To populate BDCTAB, You need to transfer each and every field)
    The major differences between Session method and Call transaction are as follows:
    SESSION METHOD CALL TRANSACTION
    1. Data is not updated in database table unless Session is processed. Immediate updation in database table.
    2. No sy-subrc is returned. Sy-subrc is returned.
    3. Error log is created for error records. Errors need to be handled explicitly
    4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.
    Error Handling in CALL TRANSACTION
    When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
    Steps for the error handling in CALL TRANSACTION
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. Internal table BDCMSG like BDCMSGCOLL
    4. Internal table similar to Ist internal table
    (Third and fourth steps are for error handling)
    5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
    6. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tr.code> using <Bdctab>
    Mode <A/N/E>
    Update <S/A>
    Messages <BDCMSG>.
    Perform check.
    Refresh BDCTAB.
    Endloop.
    7 Form check.
    IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).
    Call function Format_message.
    (This function is called to store the message given by system and to display it along with record)
    Append itab2.
    Display the record and message.
    DIRECT INPUT
    About Direct Input
    In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. Direct input checks the data thoroughly and then updates the database directly.
    You can start a Direct Input program in two ways;
    Start the program directly
    This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.
    Starting the program via the DI administration transaction
    This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).
    Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.
    First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:
    - Create variant
    - Define job
    - Start job
    - Restart job
    Common batch input errors
    - The batch input BDCDATA structure tries to assign values to fields which do not exist in the current transaction screen.
    - The screen in the BDCDATA structure does not match the right sequence, or an intermediate screen is missing.
    - On exceptional occasions, the logic flow of batch input session does not exactly match that of manual online processing. Testing the sessions online can discover by this.
    - The BDCDATA structure contains fields, which are longer than the actual definition.
    - Authorization problems.
    RECORDING A BATCH INPUT
    A B recording allows you to record a R/3 transaction and generate a program that contains all screens and field information in the required BDC-DATA format.
    You can either use SHDB transaction for recording or
    SYSTEM ? SERVICES ? BATCH INPUT ? EDIT
    And from here click recording.
    Enter name for the recording.
    (Dates are optional)
    Click recording.
    Enter transaction code.
    Enter.
    Click Save button.
    You finally come to a screen where, you have all the information for each screen including BDC_OKCODE.
    u2022 Click Get Transaction.
    u2022 Return to BI.
    u2022 Click overview.
    u2022 Position the cursor on the just recorded entry and click generate program.
    u2022 Enter program name.
    u2022 Click enter
    The program is generated for the particular transaction.
    BACKGROUND PROCESSING
    Need for Background processing
    When a large volume of data is involved, usually all batch inputs are done in background.
    The R/3 system includes functions that allow users to work non-interactively or offline. The background processing systems handle these functions.
    Non-interactively means that instead of executing the ABAP/4 programs and waiting for an answer, user can submit those programs for execution at a more convenient planned time.
    There are several reasons to submit programs for background execution.
    u2022 The maximum time allowed for online execution should not exceed 300 seconds. User gets TIMEOUT error and an aborted transaction, if time for execution exceeds 300 seconds. To avoid these types of error, you can submit jobs for background processing.
    u2022 You can use the system while your program is executing.
    This does not mean that interactive or online work is not useful. Both type of processing have their own purposes. Online work is the most common one entering business data, displaying information, printing small reports, managing the system and so on. Background jobs are mainly used for the following tasks; to process large amount of data, to execute periodic jobs without human intervention, to run program at a more convenient, planned time other than during normal working hours i.e., Nights or weekends.
    The transaction for background processing is SM36.
    Or
    Tools ? Administration ? Jobs ? Define jobs
    Or
    System ? services ? Jobs
    Components of the background jobs
    A job in Background processing is a series of steps that can be scheduled and step is a program for background processing.
    u2022 Job name. Define the name of assigned to the job. It identifies the job. You can specify up to 32 characters for the name.
    u2022 Job class. Indicates the type of background processing priority assigned to the job.
    The job class determines the priority of a job. The background system admits three types of job classes: A B & C, which correspond to job priority.
    u2022 Job steps. Parameters to be passed for this screen are as follows:
    Program name.
    Variant if it is report program
    Start criteria for the job: Option available for this are as follows:
    Immediate - allows you to start a job immediately.
    Date/Time - allows you to start a job at a specific name.
    After job - you can start a job after a particular job.
    After event - allows you to start a job after a particular event.
    At operation mode - allows you to start a job when the system switches to a particular operation mode.
    Defining Background jobs
    It is two step process: Firstly, you define the job and then release it.
    When users define a job and save it, they are actually scheduling the report i.e., specifying the job components, the steps, the start time.
    When users schedule program for background processing, they are instructing the system to execute an ABAP/4 report or an external program in the background. Scheduled jobs are not executed until they are released. When jobs are released, they are sent for execution to the background processing system at the specified start time. Both scheduling and releasing of jobs require authorizations.
    HANDLING OF POP UP SCREEN IN BDC
    Many times in transaction pop up screen appears and for this screen you donu2019t pass any record but some indication to system telling it to proceed further. For example: The following screen
    To handle such screen, system has provided a variable called BDC_CURSOR. You pass this variable to BDCDATA and process the screen.
    Usually such screen appears in many transactions, in this case you are just passing information, that YES you want to save the information, that means YES should be clicked. So you are transferring this information to BDCDATA i.e., field name of YES which is usually SPOT_OPTION. Instead of BDC_OKCODE, you are passing BDC_CURSOR.
    BDC_CURSOR is also used to place cursor on particular field.
    AN EXAMPLE WITH SESSION METHOD
    Following program demonstrates how data is passed from flat file to SAP transaction and further to database table by using SESSION method.
    The transaction is TFBA (to change customer).
    A simple transaction where you are entering customer number on first screen and on next screen data is displayed for the particular customer number. Field, which we are changing here, are name and city. When you click on save, the changed record gets saved.
    Prerequisite to write this BDC interface as indicated earlier is:
    1. To find screen number
    2. To find screen field names, type of the field and length of the field.
    3. To find BDC_OKCODE for each screen
    4. Create flat file.
    Flat file can be created in your hard disk as follows:
    1 Vinod   Hyderabad
    2 Kavitha Secunderabad
    3 Kishore Hyderabad
    (Where 1st character field is Customer number, 2nd field is Customer name and 3rd field is City.)
    To transfer this data to database table SCUSTOM following interface can be used.
    REPORT DEMO1.
    Following internal table is to upload flat file.
    DATA: BEGIN OF ITAB OCCURS 0,
    ID(10),
    NAME(25),
    CITY(25),
    END OF ITAB.
    *Following internal table BDCDATA is to pass date from internal table to session.
    DATA: BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    Variables
    DATA: DATE1 LIKE SY-DATUM. DATE1 = SY-DATUM - 1. u201C This is for Hold Date
    To upload flat file to internal table.
    CALL FUNCTION UPLOAD
    EXPORTING
    FILE NAME = u2018C:\FF.TXTu2019
    FILE TYPE = u2018ASCu201D
    TABLES
    DATA_TAB = ITAB
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    OTHERS = 6.
    If sy-subrc = 0.
    Calling Function to Create a Session
    CALL FUNCTION u2018BDC_OPEN_GROUPu2019
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = u2018POTHURIu2019
    HOLDDATE = DATE1
    KEEP = u2018Xu2019
    USER = SY-UNAME
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11.
    If sy-subrc = 0.
    *-- MAIN Logic--
    LOOP AT ITAB
    PERFORM GENERATE_DATA. u201C Populating BDCDATA Table
    CALL FUNCTION u2018BDC_INSERTu2019
    EXPORTING
    TCODE = u2018TFBAu2019
    TABLES
    DYNPROTAB = BDCTAB
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7.
    REFRESH BDCTAB
    ENDLOOP.
    Calling function to close the session
    CALL FUNCTION u2018BDC_CLOSE_GROUPu2019
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3.
    Endif.
    Endif.
    *& Form GENERATE_DATA
    Create BDC Data
    FORM GENERATE_DATA
    Passing information for 1st screen on BDCDATA
    BDCTAB-PROGRAM = u2018SAPMTFBAu2019.
    BDCTAX-DYNPRO = 100.
    BDCTAP-DYNBEGIN = u2018Xu2019.
    APPEND BCDTAB.CLEAR BDCTAB.
    Passing field information to BDCDATA
    BDCTAB-FNAM = u2018SCUSTOM-IDu2019
    BDCTAB-FVAL = ITAB-ID.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing BDC_OKCODE to BDCDATA
    BDCTAB-FNAM = u2018BDC_OKCODEu2019.
    BDCTAB-FVAL = u2018/5u2019.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing screen information for next screen to BDCDATA
    BDCTAB-PROGRAM = u2018SAPMTFBAu2019.
    BDCTAB-DYNPRO = 200.
    BDCTAB-DYNBEGIN = u2018Xu2019.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing screen information to BDCDATA
    BDCTAB-FNAM = u2018SCUSTOM-NAMEu2019.
    BDCTAB-FVAL = ITAB-NAME.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing screen information to BDCDATA
    BDCTAB-FNAM = u2018SCUSTOM-CITYu2019.
    BDCTAB-FVAL = ITAB-CITY.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing BDC_OKCODE to BDCDATA
    BDCTAB-FNAM = u2018BDC_OKCODEu2019.
    BDCTAB-FVAL = u2018SAVEu2019.
    APPEND BDCTAB.CLEAR BDCTAB.
    ENDFORM. u201CGENERATE_DATA
    AN EXAMPLE WITH CALL TRANSACTION
    Same steps to be repeated for CALL TRANSACTION
    The only difference between the two types of interface is in Session method, you create session and store information about screen and data into session. When session is processed the data is transferred to database. While in CALL TRANSACTION, data is transferred directly to database table.
    REPORT DEMO1.
    Follow above Code till MAIN Logic. Even the Subroutine should be copied
    LOOP AT ITAB
    PERFORM GENERATE_DATA, u201CPopulating BDCDATA Table
    Call transaction u2018TFBAu2019 using BCDDATA Mode u2018Au2019 Update u2018Su2019.
    REFRESH BDCTAB
    ENDLOOP.

  • Does SAP system provide 3 way matching report from PO up to payment in AP

    Dear expert,
    Would like to seek for your help to advise, does SAP system provide 3 way matching report from PO up to payment in AP  with the following information?
    Vendor Number
    Vendor Name
    AP Document Number
    AP Document Date
    Payment Document Number
    Payment Document Date
    Payment Amount
    PO reference Number and Date
    Item Description
    Please help.
    Regards,
    KH

    Hi Atif,
    Thank you for the prompt reply, however I have a few question to seek for your advise as below:
    a)I would like to know does  SAP system have any standard report which have the information of 3 way matching report from PO up to payment in AP module?
    b) I have find one report using T-code:FBl1N (vendor line item) is able to display the report with information of invoice,payment and there is one field purchasing document in the report however this field do not have any po number refer to the invoice.
    I would like to know what the field purchasing document mean for (i.e what are the information capture on the column purchasing document)?
    Please help.
    Regards,
    KH

  • Please provide the abap code for below requirement

    note: if the user exit is not suitable please provide the suitable user exit and code
    1   Business requirement
          In order to update the postings and tracking on Buffer Account postings the User Exists need to be modified and extended where possible in order to trace the Buffer postings in applicable MM and FI reports , i.e. at PO level, GR level and IR level.
    The User-exit used in the document is only for transactions at Invoice Verification level (MIRO).
    Therefore when an Invoice is created and the requirements for Buffer Account postings are met, i.e. relevant doc types and AAC, a table for Buffer Account entries and a subsequent report is required in order to trail the various Buffer entries and postings.
    The User Exit : LMR1M003.
    The Component is  EXIT_SAPLMRMP_003 . 
    The user-exit (LMR1M003) gets triggered when an Invoice is created or changed (MIRO). When an Invoice is cancelled, all entries will have to be reversed.
    The code in this user-exit will identify the invoice number (bkpf-belnr)  that has been created or changed and thus post entries in the applicable buffer accounts for this purpose.
    2.0   Buffer Table
    The Buffer Account table for the Invoice will have the following fields
    Field      DataElement      Data Type     Description                              Saptable     
    mandt     mandt          clnt          client                         key     init     bkpf
    bukrs     bukrs          char          companycode                    key     init     bkpf
    belnr     belnr_d     char          accountdocumentno               key     init     bkpf
    gjahr     gjahr          numc          fiscalyear                    key     init     bkpf
    kostl     kostl          char          cost center                    key     init     csks     
    ebeln     ebeln          char          purchasing document number     key     init     ekko     
    blart     blart          char          document type                         bkpf
    bldat     bldat          dats          document date in document                    bkpf     
    budat     budat          dats          posting date in document                    bkpf
    xblnr     xblnr1          char          reference document number                    bkpf
    bstat     bstat_d     char          Document Status                         bkpf
    xstov     xstov          char          indicator: document is flagged for reversal          bkpf
    xmwst     xmwst          char          calculate tax automatically                    bkpf
    reindat     reindat          dats          invoice receipt date                         bkpf
    werks     werks_d     char          plant                                    csks
    wrbtr     wrbtr          curr          amount in document currency               bseg     
    bsart     esart          char          po doc type                              ekko     
    ebelp     ebelp          numc          item number of purchasing document          bseg     
    nplnr     nplnr          char          network number for account assignment          bseg     
    knttp     knttp          char          account assignment category                    ekpo
    3.0   Detail Design
    3.1   Invoice Details
    •     The User-exit LMR1M003 is only to be used at Invoice level (MIRO).
    •     The user-exit (LMR1M001) gets triggered when an Invoice is created or changed (MIRO) .the field name bkpf-belnr is fetched from the table bkpf and checked whether document created or changed and triggers the user exit LMR!M003 .
    •     When an Invoice is cancelled, all entries will have to be reversed this is done by checking the value of flag indicator  bkpf-xstov fetched from the table bkpf .
    •     The code in this user-exit will identify the invoice number that has been created or changed and thus post entries in the applicable buffer accounts for this purpose.

    Cross-post: http://forum.java.sun.com/thread.jspa?threadID=763485

  • Please provide the Message type ,IDOC TYPE , PROCESS CODE for Edi 990 ,214

    Hi friends,
    Please provide the Message type ,IDOC TYPE , PROCESS CODE for Edi 990 (Response to a Load Tender)., 214 (Shipment Status )
    For shipement status i got trxstc01 for idoc type .. but its only before 4.6 version ..for 4.7 its not there .. please give the alternate for that ...
    Thanks in Advance ....
    If any one is provide exact answer i will give Max marks ..
    Edited by: ajay KOLLA on Aug 6, 2009 8:04 AM

    Hi,
    Have you resolved this issue. If yes, can you please let me know. Im actually looking for same for EDI 867 (guess it is for summary report and need to know message type, Idoc type associated with this).
    Rgds
    Sudhanshu

  • BI contents for AR related reports

    Hi all:
    I am designing several reports with BI contents. Since I am not so familiar with BI contents, I can only find the majarity of my reports, while for below reports, I can not find the corresponding content for them. Can any body give me some guide like which contents are suitable for those reports? Many thanks~
    Report Name:
    - DSO Planning
    - Bad Debt Reserve
    - Credit Review Reporting
    - Expiring Securities Report
    - Credit Reference Reporting (Web site)
    Thanks and Best Regards !
    Steven

    Hi Steven,
    SAP has provided around 4600 standard reports in BI related to all modules.Provide me your mail so that i can send u the list.
    Regards
    Ram.

  • Problem "The OLE DB provider for linked server reported an error. The provider reported an unexpected catastrophic failure Cannot fetch a row from OLE DB provider for linked server"

    hi
      i'd like to ask question about linked server.
      my linked server used to work but now when i try to select from linked server i was told "The OLE DB provider for linked server reported an error. The provider reported an unexpected catastrophic failure Cannot fetch a row from OLE DB provider
    for linked server"
      but in fact for test connection i was told "the test connection to the linked server succeeded".
      could  anyone help me? thank u very much
    best regards
    martin

    Hi, 
    In addition to Tracy's post we have to know those answers as well:
    * what provider are you using for the connection
    * what do you connect to
    for example, if someone try to connect to oracle using sql server provider then several simple queries are going to work probably OK, but once you are trying to use T-SQL or any complex SQL query then the errors are starting.
    please post the connection string (without the password!) + the query that you are trying to use.
    [Personal Site] [Blog] [Facebook]

  • Please provide a valid link to download SAPWidgetFoundation.jar/zip

    Hi,
         I am willing to develop some widgets to display R/3 information for End Users.
         I have already downloaded the following tools:-
         1. eclipse-jee-europa-winter-win32.zip
         2. SAPWidgetDevelopmentTools - zip file.zip
         Please let me know the relation between above 2- downloaded tools by me.
    Please provide me a valid link to SAPWidgetFoundation.jar/zip, so that I can start working on Enterprise Widgets.
    Also, How I can use NWDS 7.0 SP19 for development of widgets?
    Regards,
    Tushar.

    Hi,
         Any inputs for the question?
    Regards,
    Tushar

  • Please provide a program or  fm to find a table in transaction

    Please provide a program or  fm to find a table in transaction
    tell me some methods

    "1st
    This  is the Table  name  : D010TAB
    Execute the table  in se16 ,  give your Program name  it will list all  Tables used  in this  Program .
    or else 
    "2nd
    Function Module  :  GET_TABLES .
    Execute this FM  in SE37 ,  give your Program name  it will list all  Tables used  in this  Program .
    "3rd
    This is the Program  which will give you the  List of tables   used  in your Program .
    REPORT ztesttables.
    DATA line(100) TYPE c .
    DATA:itab TYPE TABLE OF line,
    wa_tab LIKE LINE OF itab.
    PARAMETER program TYPE sy-repid.
    CALL FUNCTION 'GET_TABLES'
    EXPORTING
    progname = program
    TABLES
    tables_tab = itab.
    SORT itab BY line.
    DELETE ADJACENT DUPLICATES FROM itab COMPARING line.
    LOOP AT itab INTO wa_tab.
    WRITE wa_tab-line.
    ENDLOOP.
    Reward  points if it is usefull ...
    Girish

  • Please provide me steps for SOP

    hi,
    please provide me the configuration steps related to SOP.
    because i am not able to do it properly.
    that is the reason i am asking from teh begining of creation of material master data.
    please help me on this.
    thanx in advance
    regards,
    balaji

    Dear Balaji,
    Plz refer this steps
    Step 1 :
    Create Product group using T.code MC84
    Enter all the members in the product group , aggregate factor as 1 and proportion of your choice for example if you have 10 materials then you can enter in equal proportions ( Total % Should be 100 only or proportion based on your business)
    Step 2:
    Create planning for Product Group using T.Code MC81
    The system by default proposes a version which you can accept or you can enter a planning version of your choice )
    then the plan will be saved under version number XXX.
    Step 3 :
    Break down Product Group Plan using T.code MC76
    select Inactive version , select Disaggregate sales plan or Disaggregate Production plan radio button
    Step 4 :
    Copy Planning version using T.code MC78
    Enter :
    Source version = Inactive version which the system proposes or you have created for example 025
    Target Version = Active version in to which the inactive version should be copied for example A00. and copy it.
    Step 5 :
    Transfer Planning Data to Demand Management using T.Code MC75
    Select radio Button for Prod. plan for materials or PG membersas proportion of PG
    ENTER the requirements Type and version and check the Activate the active check Box and click Transfer now then
    The planning data is transferred to Demand Management .
    Regards
    Madhu Kumar

  • Please provide me how change the Materil using BAPI...?

    Hi Guru's,
    could please provide me how change the Materil using BAPI...
    please provide the BPAI name and step by step process...
    if ou provide any program logic that would be helpfull to me...
    thanks in advance
    Srinivas....

    Hi,
    THis is code .
    *& Report Zs_MATMAS_BAPI
    *& This program demonstrates how easy it is to create Material master
    *& data using BAPI_MATERIAL_SAVEDATA
    *& The program also generates a report post-execution displaying errors
    *& as well as successful uploads
    REPORT Zs_MATMAS_BAPI.
    TABLES
    FLAGS *
    DATA: F_STOP. " Flag used to stop processing
    DATA DECLARATIONS *
    DATA : V_EMPTY TYPE I, " No. of empty records
    V_TOTAL TYPE I. " Total no. of records.
    STRUCTURES & INTERNAL TABLES
    *BAPI structures
    DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
    BAPI_MAKT LIKE BAPI_MAKT, " Material Description
    BAPI_MARA1 LIKE BAPI_MARA, " Client Data
    BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
    BAPI_MARC1 LIKE BAPI_MARC, " Plant View
    BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
    BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
    BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
    BAPI_RETURN LIKE BAPIRET2. " Return Parameter
    *--- Internal table to hold excel file data
    DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    *--- Internal table to hold Matetrial descriptions
    DATA: BEGIN OF IT_MAKT OCCURS 100.
            INCLUDE STRUCTURE BAPI_MAKT.
    DATA: END OF IT_MAKT.
    *--- Internal to hold the records in the text file
    DATA : BEGIN OF IT_DATA OCCURS 100,
                WERKS(4), " Plant
                MTART(4), " Material type
                MATNR(18), " Material number
                MATKL(9) , " Material group
                MBRSH(1), " Industry sector
                MEINS(3), " Base unit of measure
                GEWEI(3), " Weight Unit
                SPART(2), " Division
                EKGRP(3), " Purchasing group
                VPRSV(1), " Price control indicator
                STPRS(12), " Standard price
                PEINH(3), " Price unit
                SPRAS(2), " Language key
                MAKTX(40), " Material description
                END OF IT_DATA.
    SELECTION SCREEN. *
    SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
    PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
    'C:\Material_master.XLS'.
    PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
    PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
    PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
    P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
    P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
    P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK SCR1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *--- Validating file
      PERFORM VALIDATE_FILE USING P_FILE.
    START-OF-SELECTION
    START-OF-SELECTION.
    *--- Perform to convert the Excel data into an internal table
      PERFORM CONVERT_XLS_ITAB.
      IF NOT IT_DATA[] IS INITIAL.
    *--- Perform to delete Header lines
        PERFORM DELETE_HEADER_EMPTY_RECS.
      ENDIF.
    END OF SELECTION. *
    END-OF-SELECTION.
    *--- Perform to upload Material Master data
      PERFORM UPLOAD_MATMAS.
    Form : validate_input_file
    Description : To provide F4 help for file if read from PC
    FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = F_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC  0.
        MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
      ENDIF.
    ENDFORM. " validate_input_file
    *& Form CONVER_XLS_ITAB
    text
    FORM CONVERT_XLS_ITAB.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME    = P_FILE
          I_BEGIN_COL = P_BEGCOL
          I_BEGIN_ROW = P_BEGROW
          I_END_COL   = P_ENDCOL
          I_END_ROW   = P_ENDROW
        TABLES
          INTERN      = IT_INTERN.
      IF SY-SUBRC  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *--- Perform to move the data into an internal data
      PERFORM MOVE_DATA.
    ENDFORM. " CONVERT_XLS_ITAB
    *& Form MOVE_DATA
    text
    FORM MOVE_DATA.
      DATA : LV_INDEX TYPE I.
      FIELD-SYMBOLS <FS>.
    *--- Sorting the internal table
      SORT IT_INTERN BY ROW COL.
      CLEAR IT_INTERN.
      LOOP AT IT_INTERN.
        MOVE IT_INTERN-COL TO LV_INDEX.
    *--- Assigning the each record to an internal table row
        ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS>.
    *--- Asigning the field value to a field symbol
        MOVE IT_INTERN-VALUE TO <FS>.
        AT END OF ROW.
          APPEND IT_DATA.
          CLEAR IT_DATA.
        ENDAT.
      ENDLOOP.
    ENDFORM. " MOVE_DATA
    *& Form DELETE_HEADER_EMPTY_RECS
    To delete the Header and empty records
    FORM DELETE_HEADER_EMPTY_RECS.
      DATA: LV_TABIX LIKE SY-TABIX.
      IF NOT P_HEADER IS INITIAL.
        LOOP AT IT_DATA.
          IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
            DELETE IT_DATA FROM 1 TO P_HEADER.
    P_HEADER = 0.
            EXIT.
          ENDIF.
        ENDLOOP.
      ENDIF.
      CLEAR IT_DATA.
    *--- To delete the empty lines from internal table
      LOOP AT IT_DATA.
        LV_TABIX = SY-TABIX.
        IF IT_DATA IS INITIAL.
          V_EMPTY = V_EMPTY + 1.
          DELETE IT_DATA INDEX LV_TABIX..
        ENDIF.
      ENDLOOP.
      CLEAR IT_DATA.
    *--- Total no of recs in file
      DESCRIBE TABLE IT_DATA LINES V_TOTAL.
      IF V_TOTAL = 0.
        MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
        F_STOP = 'X'.
        STOP.
      ENDIF.
    ENDFORM. " DELETE_HEADER_EMPTY_RECS
    *& Form UPLOAD_MATMAS
    to upload Material Master data
    FORM UPLOAD_MATMAS .
      LOOP AT IT_DATA.
    Header
        UNPACK IT_DATA-MATNR TO IT_DATA-MATNR.
        BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
        BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
        BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
        BAPI_HEAD-BASIC_VIEW = 'X'.
        BAPI_HEAD-PURCHASE_VIEW = 'X'.
        BAPI_HEAD-ACCOUNT_VIEW = 'X'.
    Material Description
        REFRESH IT_MAKT.
        IT_MAKT-LANGU = IT_DATA-SPRAS.
        IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
        APPEND IT_MAKT.
    Client Data - Basic
        BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
        BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
        BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
        BAPI_MARA1-DIVISION = IT_DATA-SPART.
        BAPI_MARAX-MATL_GROUP = 'X'.
        BAPI_MARAX-BASE_UOM = 'X'.
        BAPI_MARAX-UNIT_OF_WT = 'X'.
        BAPI_MARAX-DIVISION = 'X'.
    Plant - Purchasing
        BAPI_MARC1-PLANT = IT_DATA-WERKS.
        BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
        BAPI_MARCX-PLANT = IT_DATA-WERKS.
        BAPI_MARCX-PUR_GROUP = 'X'.
    Accounting
        BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
        BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
        BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
        BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEWX-PRICE_CTRL = 'X'.
        BAPI_MBEWX-STD_PRICE = 'X'.
        BAPI_MBEWX-PRICE_UNIT = 'X'.
    *--- BAPI to create material
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
        HEADDATA = BAPI_HEAD
        CLIENTDATA = BAPI_MARA1
        CLIENTDATAX = BAPI_MARAX
        PLANTDATA = BAPI_MARC1
        PLANTDATAX = BAPI_MARCX
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA =
    STORAGELOCATIONDATAX =
    VALUATIONDATA = BAPI_MBEW1
    VALUATIONDATAX = BAPI_MBEWX
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA = BAPI_MVKE1
    SALESDATAX = BAPI_MVKEX
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
        IMPORTING
        RETURN = BAPI_RETURN
        TABLES
        MATERIALDESCRIPTION = IT_MAKT
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
        IF BAPI_RETURN-TYPE = 'E'.
          WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-MATNR.
        ELSEIF BAPI_RETURN-TYPE = 'S'.
          WRITE: 'Successfully created material' ,IT_DATA-MATNR.
        ENDIF.
      ENDLOOP.
    ENDFORM. " UPLOAD_MATMAS
    Thanks
    Sarada

Maybe you are looking for

  • HTTP reciever adapter URL parameters

    Hello all, I have a question regarding passing parameters as querystring in the url of reiever HTTP adapter. This is an RFC> XI> HTTP scenario and we're posting to an external URL. Here are the details URL: xxxx.yyyyy.com Service Number: 80 Path: /ap

  • 8pin to 3.5mm cord

    I need a 8 pin iphone cable on one end and a 3.5 mm av cable on the other...does apple or anyone make this type of wire? thanks

  • How SAP device type SWIN sends a page format?

    Hi all, I changed page format (from DINA4 to INCH12) for my SmartForm and try it print with SWIN (I2SWIN) device type. It has printed with cca 11 xx paging (not full 12") so next pages move upper and upper. So I have printed it to Text printer in Win

  • Cannot Drag 'n Drop in Photoshop CS3 on Mac

    Very frustrating. I cannot drag 'n drop any image file from Bridge CS3 or from Mac's Finder onto a Photoshop CS3 canvas. In older versions, I've been able to easily drag/drop images, but I am perplexed on how to solve this. I've read about having an

  • Adhoc Step runtime excution process.

    Hi Friends,     I have a scenario where AdHoc step is being used. As per my knowledge till now this step is used for runtime selection of process (i.e. which work flow we want to continue at run time). And for selecting that wf we have to goto graphi