HI ABAP GURUS

HI ALL,
    I M USING LT31 ( PRINT TRANSFER ORDER)......................IN BDC ..............
   i  m passing TO number ans TO item.................................................
  this my code...........................
IF ITAB[] IS NOT INITIAL.
    LOOP AT ITAB.
      REFRESH BDCDATA.
  PERFORM BDC_DYNPRO      USING 'SAPML03T' '0125'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'RLDRU-SPOOL'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=DRU'.
  PERFORM BDC_FIELD       USING 'LTAK-LGNUM'
                                'W01'.
  PERFORM BDC_FIELD       USING 'LTAK-TANUM'
                               ITAB-TANUM."'804'."
PERFORM BDC_FIELD       USING 'LTAP-VBELN'
                               '01'."ITAB-TAPOS.
PERFORM BDC_FIELD       USING 'RL03T-TAPOS'
                                ITAB-TAPOS."'01'.
PERFORM BDC_FIELD       USING 'RLDRU-DRUKZ'
                               '01'.
PERFORM BDC_FIELD       USING 'RLDRU-LDEST'.
                               P_LDEST.
  PERFORM BDC_FIELD       USING 'RLDRU-SPOOL'
                                '01'.
  PERFORM BDC_FIELD       USING 'RLDRU-DRUCK'
                                'X'.
  PERFORM BDC_FIELD       USING 'RLDRU-TASCH'
                                'X'.
CALL TRANSACTION 'LT31' USING BDCDATA MODE 'A'.                               
ENDLOOP.
ENDIF.
it is printing multiple print of single TO number...........................
means........TO number,1 items.......TO number,2 item
but requirement is that for one TO one print..............
here i m passing items excluding cancel one..................
give me some solution ..........so that i can print all items of TO number in single print..
thanks in advance..........
Reghards,
Imran

Hi Imran,
Do As below
IF ITAB[] IS NOT INITIAL.
LOOP AT ITAB.
[<i>b]REFRESH BDCDATA.</b></i> <b>-> Remove this</b>
PERFORM BDC_DYNPRO USING 'SAPML03T' '0125'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RLDRU-SPOOL'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=DRU'.
PERFORM BDC_FIELD USING 'LTAK-LGNUM'
'W01'.
PERFORM BDC_FIELD USING 'LTAK-TANUM'
ITAB-TANUM."'804'."
PERFORM BDC_FIELD USING 'LTAP-VBELN'
'01'."ITAB-TAPOS.
PERFORM BDC_FIELD USING 'RL03T-TAPOS'
ITAB-TAPOS."'01'.
PERFORM BDC_FIELD USING 'RLDRU-DRUKZ'
'01'.
PERFORM BDC_FIELD USING 'RLDRU-LDEST'.
P_LDEST.
PERFORM BDC_FIELD USING 'RLDRU-SPOOL'
'01'.
PERFORM BDC_FIELD USING 'RLDRU-DRUCK'
'X'.
PERFORM BDC_FIELD USING 'RLDRU-TASCH'
'X'.
ENDLOOP.
CALL TRANSACTION 'LT31' USING BDCDATA MODE 'A'.
Reward points if useful.
Regards,
Atish

Similar Messages

  • Hai abap gurus...

    difference bet'n simple and interactive reports?
    what are the events in interactive reports?
    what is the first event that will be triggered in a report?
    what is the use of Initialization event? give one example.
    what is the use of start-of-selection event?
    what is the difference betn end-of-page and end-of-selection?
    if you write a write statement after end-of-selection, will that be
    triggered?
    how to create a button in selection screen?
    how to add a gui status in a selection screen?
    what is at-line-selection event?

    Hi,
    1> A simple report is a standard report where as Interactive report is a Drilled down report.A Simple report is one where we get the data from a single table n display it as a single output...Where as in Interactive report we can get the data from different tables n display it on different output screens......once if we click on any field on the basic list then we get its details on the next secondary list.
    2> The events in Interactive reports are...
    Initialization, At selection-screen, Start-of-selection, top-of-page, end-of-page, end-of-selection, At User-command, Set pf-status and top-of-page during Line selection, At line-selection.
    3> The event that will be triggered in a report is Initialization if only the debugging is done from the Abap-Editor.....If the debugging is done from the program then Start-of--selection gets triggered.
    4>Initialization - It is a process that takes place after the seelction screen could display.
    eg;
    select-option matnr for mara-matnr.
    matnr-low = '00'.
    matnr-high = '1000'.
    matnr-sign = 'i'.
    matnr-option = 'bt'.
    Append matnr.
    5> Start-of-selection is a default event.....
    All the statements under start-of-selection must be executed before it goes for the next statement.
    6> End-of-page id used to display all the statements on the last line of the page. where as end-of-selection triggers at the end of the program.....
    Eg;
    End-of-page.
    write:/10 'System date:', sy-datum, 30 'page no:', sy-pagno.
    End-of-selection.
    write :/ "end of the program".
    7>If u write a write statement after end-of-selection it will trigger......as it starts from initialization and then goes to Start-of-selection n then to end-of selection so if u write it will get triggered.
    8> To create a Push Button just use this statement Selection-screen Pushbutton 
      /30(30) text-001 user-command enter(anything u can give).
    double click on the text-001 and give the respective name.
    9> At line-selection is used to view a detailed list of a report....For example if u had created a report on material n if u want to get the details from marc n mard tables then display them on the next list then we use at Line-selection...So that when we click on a specific field on the basic list it will display the secondary list with marc details........so thats why its called as drilled down report....as we can have 21 list..
    In which the first list is the Basic List and the other 20 lists are the secondary lists.
    When u try to click on a field to get the details in the next secondary list that field should be kept in Hide.
    Hide is a statement that temporarily stores the contents of the clicked field in the 'Hide Area'.
    Hide statement is always followed by the write statement.
    eg; start-of-selection.
    select * from mara into table itab where matnr in matnr.
    loop at itab.
    write:/ itab-matnr, itab-ernam, itab-ersda.
    hide itab-matnr.
    endloop.

  • Hi there Abap gurus,

    hi there all,
    can any one tell me how can i hord code this tables in the program.
    im not sure how to hard code them.
    the selection screen only will b the date.
    when they put the date, the system has to do searching
    for this 2 fields DMBTR u2013 Amount in local currency
    DMBE2 u2013 Amount in USD currency
    from bsik, and bsid tables.
    this report is very urgent.
    please help me.
    thanks
    Table A
    Customer     Customer Selections
    AP10     AP10 + 1000413 + 8000000
    APLLC     6000015
    AU10     AU10 + 1000165 + 1000350 + 1000385 + 1000546 + 1000654 + 1000996 + 1001011 + 1001315 + 1001547 + 1001806
    CN10     CN10 + 1000380
    CN20     CN20 + 1000379 + 1000539 + 1000556 + 1000894 + 1001258 + 1002024 + CN21 + 1000814
    HK10     HK10 + 1000828 + 1001781
    IN20     1000214 + 1000892 + 1001124 + 1001192 + 1001234 + 1001282 + 1001321 + 8000106
    JP10     JP10
    MY10     MY10 + 8000059
    MY20     MY20 + 1000458 + 1000596 + 1001293 + 6000001 + 8000082
    SG10     SG10 + 1000346 + 6000005
    SC GERMANY     1000743
    SC INC     1000751 + 1001420 + 6000000
    SC SA     1000884 + 6000002
    SC UK     -
    SC WERNDLE     1000738
    Table B
    Vendor     Vendor Selections
    AP10     AP10 + 1000001
    APLLC     2000030
    AU10     AU10 + 1000005
    CN10     CN10 + 2201196
    CN20     CN20 + CN21
    HK10     HK10 + 2000015
    IN20     1000040
    JP10     JP10 + 1000020
    MY10     MY10
    MY20     MY20 + 1000035 + 2000010
    SG10     SG10
    SC GERMANY     -
    SC INC     2000000
    SC SA     1000002
    SC UK     2000012
    SC WERNDLE     1000000

    hi there,
    Business Specification:
    The business requires the system to generate report which can give information on inter company customer and vendor balance.
    Requirement:
    This report will be triggered by the new customised ABAP program. The program should extract the customeru2019s balance from BSID and BSAD and vendoru2019s balance from BSIK and BSAK table as per selected report date. This program actually will act similar as report FBL5N-Customer Balance and FBL1N-Vendor Balance. Total balance as at report date should be tally with both reports.
    Type of functionality:
    u2022     on-line transaction
    u2022     ad-hoc, whenever needed
    Data Selection:
    To add selection fields at General Selection
    1.     Report date (Required entry)
    Description of any new data elements required (if known) e.g. tables:
    u2022     BSID
    u2022     BSAD
    u2022     BSIK
    u2022     BSAK
    Process Logic:
    For Customer balance:
    Use Report date entered by the user as open item as at key date to find total of customer open item in table BSID and BSAD.
    For Vendor balance:
    Use Report date entered by the user as open item as at key date to find total of Vendor open item in table BSIK and BSAK.
    File mapping:
    No     Table     Field      Field Description/ Remarks
    1     Hardcode     -     Customer No - Consist of several customer numbers. Refer table A. Will also represent the company code (Y).
    2     Hardcode     -     Customer No - Consist of several customer numbers. Refer table B. Will also represent the company code (X).
    3     BSID/BSAD     DMBTR u2013 Amount in local currency
    DMBE2 u2013 Amount in USD currency     Total balance for customer in Y in company code X.
    4     BSIK/BSAK     DMBTR u2013 Amount in local currency
    DMBE2 u2013 Amount in USD currency     Total balance for vendor in X in company code Y.
    Table A
    Customer     Customer Selections
    AP10     AP10 + 1000413 + 8000000
    APLLC     6000015
    AU10     AU10 + 1000165 + 1000350 + 1000385 + 1000546 + 1000654 + 1000996 + 1001011 + 1001315 + 1001547 + 1001806
    CN10     CN10 + 1000380
    CN20     CN20 + 1000379 + 1000539 + 1000556 + 1000894 + 1001258 + 1002024 + CN21 + 1000814
    HK10     HK10 + 1000828 + 1001781
    IN20     1000214 + 1000892 + 1001124 + 1001192 + 1001234 + 1001282 + 1001321 + 8000106
    JP10     JP10
    MY10     MY10 + 8000059
    MY20     MY20 + 1000458 + 1000596 + 1001293 + 6000001 + 8000082
    SG10     SG10 + 1000346 + 6000005
    SC GERMANY     1000743
    SC INC     1000751 + 1001420 + 6000000
    SC SA     1000884 + 6000002
    SC UK     -
    SC WERNDLE     1000738
    Table B
    Vendor     Vendor Selections
    AP10     AP10 + 1000001
    APLLC     2000030
    AU10     AU10 + 1000005
    CN10     CN10 + 2201196
    CN20     CN20 + CN21
    HK10     HK10 + 2000015
    IN20     1000040
    JP10     JP10 + 1000020
    MY10     MY10
    MY20     MY20 + 1000035 + 2000010
    SG10     SG10
    SC GERMANY     -
    SC INC     2000000
    SC SA     1000002
    SC UK     2000012
    SC WERNDLE     1000000
    they wan t to do develop a program with specs

  • How to get the name of an executing ABAP query in run time

    Hi ABAP Gurus,
    I need to get the ABAP query name when it's running. For example we can get the current executing ABAP program name from SY-REPID.
    My tried logic - every query generates an ABAP program like AQZZUGQUERY. 'UG' stands for user-group name and the length specified for it is 12, if the length of the user-group name is less than 12, then the rest will be filled by '='. Next 'QUERY' stands for ABAP query name and the length specified for it is 14, if less, then the rest will be filled in with '=' in the right. I've tried to extract the query name by using cut and trip (offset) operations.
    But somehow this logic is not working - always it's picking up the function name as checked in debug mode.
    Guys - Can you please provide me the solution on this.
    Thanks & regards,
    Jayanta Bej.

    Guys,
    I've cracked the issue. Instead of retrieving the query name from sy-repid, I've retrieved it from sy-cprog and the problem is resolved.
    Thanks guys for your quick responses.
    Thanks and regards,
    Jayanta Bej.

  • ABAP HR: Program that will compare HR Data from System GH* and GO*

    Hi ABAP Gurus,
    Good day.
    I have a requirement wherein I need to create an HR Report Program (using logical database PNP) and RFC FM wherin I will select and then compare HR Data in GH* and GO* system.  This enhancement will be done in the GH* system. 
    Do you guys have any documentation, sample programs on how to proceed with this?   Any inputs on this will be highly appreciated.
    Thank you very much!
    Best regards.
    Brando Braganza
    Moderator message - Duplicate post locked
    Edited by: Rob Burbank on May 12, 2009 12:09 PM

    HI,
      your code works perfectly well.. I have added the PNP logical database and selection screen 100... i think you r not added this PNP logical database
    *& Report  ZTESTPRG                                                    *
    REPORT  ZTESTPRG                                .
    TABLES: PERNR.
    INFOTYPES: 0002, 0006.
    GET PERNR.
      PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.
        WRITE: P0002-PERNR, P0002-NACHN, P0002-VORNA.
      ENDPROVIDE.
    Thanks
    mahesh

  • Help In ABAP Object Certification Question

    Hi ABAP Gurus,
       iam going to write certification Exam on Nov 11. i have got some model question from SAP domain for all the topics Except ABAP Objects which is so important...
    Please anybody send me some Example question you guys got from the Certification Exam
    it will be be grateful to me...
    Thanks a lot in advance.
    Prabhu
    SAP Lead Consultant

    Hi,
    Sending ABAP Objects questions is not an option but normally, your concepts are tested for:
    - Classes and objects
    - Inheritance
    - Casting
    - Interfaces
    - Events
    - Global classes and interfaces
    - Exception handling
    - Dynamic programming
    You can use help.sap.com to take a look at these topics one by one. Hope this helps.
    Good luck.

  • Help in ABAP Obj Sample Question

    Hi ABAP Gurus,
    iam going to write certification Exam on Nov 11. i have got some model question from SAP domain for all the topics Except ABAP Objects which is so important...
    it will be be grateful to me if anybody send some ques...
    Thanks a lot in advance.
    Prabhu
    SAP Lead Consultant

    Hi,
        Some questions
    1) Which tool can be used to move a method of a class to an interface which the class implements?
    2) Can a CLASS-CONSTRUCTOR be defiend to raise exceptions?
    3) Can you access PROTECTED data using object reference of a subclass?
    4) Can a class method raise both normal exceptions and class based exception?
    It will be helpful if you share the links of other topics
    Regards,
    Sesh

  • Pointers on ABAP documentations (Database/Respositories/Structures/Tables/

    Hi ABAP Gurus/Experts,
    I am basically a SAP Functional consultant, but recently taken a new assignment on SAP Net Weaver MDM, where in i require lot of ABAP knowledge mainly in Database area, like Structure, Tables, Data Objects etc,
    I am looking for an good ABAP documentations on Database/Repositories/Structures/Tables/Data Objects etc.
    Good pointers will be Fully Rewarded.
    Regards
    Rehman

    Hi,
    Go thru this link for ABAP Programming,
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
    To start with you should use book....
    [bTeach yourself ]ABAP in 21 Days...by SAMS publication.
    this book will fundamentally stat up with basics of SAP and ABAP..
    it will b the best to start with...
    you can get it here...
    http://www.allfreetech.com/EBook_index.asp?CategoryID=1
    ABAP has so many contents. start learning one by one;
    First pay attention to basic chapters like REPORTS, SCRIPTS, TRANSACTIONS, and BDC's,.Once you become perfect start learning other chapters. To learn Netweaver Java is very useful
    go through the links:
    Start with this.Refer this
    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Reports
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SAPScripts
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    Debugging Document.
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    Regards,
    Padmam.

  • Error in Consuming external WSDL in ABAP

    Dear Gurus,
    I am trying to consume a WSDL in ABAP using enterprise services in SE80. After load the WSDL and making logical port, when i test the WSDL, it gives  an error : (SOAP:1.008 SRT: Couldn't create Object: ("ICF Error when creating HTTP client object by Config for U )
    Can any body tells what is the cause of this error? I tried but unable to resolve the problem. Help from integration and ABAP gurus is required. Thanks

    Hello Imran,
    Have you tried, or is it practicable for your situation, to create the consumer service and the logical port using the URL directly, instead of a local file? (as you have shown in your print, it looks to me that it's local file)
    Maybe you can check if this WS has been used normally by other consumers, or even test it with SoapUI to guarantee it is functional (also to compare the requests). You could put this WSDL under a validation tool, i know that SAP does it when the WSDL is under processing, and it goes wrong when some elements/attributes aren't supported ... and i see you could upload it successfully, but despite of it is good to double check.
    Good luck!
    Renan

  • ABAP Server Proxy OR RFC - for attaching a file

    Hello ABAP gurus,
    Just to give a brief background, systems involved are ERP and PI
    Certain Files (3 files to be exact) are generated in the ERP directory/file system
    I need to transfer these files to PI "without" using the readily available FTP/NFS adapters (this is a limitation - no use of direct FTP is allowed)
    Making the directory as a "shared" directory between ERP and PI is also not an option.
    With the scenario above, I though of using an RFC or an ABAP Server Proxy to attach the said files to send them to PI
    Which is the better way to do it?
    I've seen a documentation for the ABAP Server Proxy that makes it possible to attach files to the proxy message, but for RFC I don't know if this is possible?
    Your expert advise is highly appreciated

    hI,
    Use class CL_PROXY_CLIENT in the program and method IF_PROXY_CLIENT~EXECUTE.
    You can refer documentation of this class as well as if you will search on any search portal using name of this class, you will get the briefe idea with the refernce procedure too.
    Unfortunately I am unable to post you few links but try search on it, hopefully you will get it.
    try below link.
    <link to blocked site removed by moderator>
    Edited by: Thomas Zloch on Oct 7, 2011 10:37 AM

  • ABAP Program to List: Budget/Actual/Commitment

    Hello ABAP Gurus,
    I have a very urgent requirement to write a report to list Budget/Actual/Commitment of all the internal orders related to a given company code. I am using ECC 5.0.
    I found very usefull information in this thread.
    Re: Abap report for budget/actual/commitment
    Could any one please send me the logic of your program . .. Please.. It will really help me..
    Thanks in advance.
    Helen.

    hi
    Please reply with the fields for your selection screen. i assume company code is one field. is fiscal year, period etc., are also part of the selection screen?
    Based on the fields that you choose a report can be done.
    looking forward for the update.
    Thanks.

  • Background processing for ABAP report with selection screen

    Hi ABAP Gurus,
    I m facing a strange problem in scheduling a background job for my report with a selection screen. I have a variant for the report.
    I scheduled a job, but it seems to be not doing anything though all the system resources are available. The job overview shows "Acive" for the job. The job is neither stopping anything, it is just sitting there In SM50, the status shows "On Hold".
    Any ideas/comments on the problem and how this can be overcome?
    Qucik replies and solutions will be highly appreciated as this is a crucial part for a go-live project.
    Thanks in advance.
    Shivani.

    Yes. My report has a selection-screen which requires user input. But I have created  a variant for the report and trying to run it in background using this variant. But facing this problem.
    Strange thing is, instead of the usual SM36/SM37 option where we schedule and monitor background jobs, this option does not work for my report.
    But I tried through SE38, and from my selection screen I selected "Schedule background job" and "run immediately" option, and this works. Though I still use SM37 to monitor this background job.
    I have never faced such a situation before.
    Any hints/tips why this happens and how this can be overcome in the future?
    Thanks in advance.
    Shivani.

  • Manpower output (HR-ABAP Payroll)

    Hi ABAP Gurus,
    I have done manpower detalis using PNP logical database.
    this program is regarding manpower details according to plant wise and payroll area wise.
    for this i have used smart forms, but where ever i call smartform function, the output is comming as n times(i.e single output for each pernr )
    Can you please help me out.
    Thanks and Regards,
    Giri

    Hi
    See this sample report to display Cost center wise Man power and do accordingly
    report zporgr0040
           line-size 108
           line-count 60(1)
           no standard page heading
           message-id zndc.
    Database Tables
    tables: hrp1001,     " HR Master Record (Orgn. Assignment)
            pa0002,      " Personal Data
            t528t,       " Position Texts
            t527x,       " Org Unit Text
            t528b,       " Positions
            csks,        " Cost Center
            cskt.        " Cost Center Texts
    Declaration of Internal Tables
    Internal Table for Orgn Object Data  HRP1000
    data: begin of obj_tab occurs 0,
            otype like hrp1000-otype,      " Object Type
            objid like hrp1000-objid,      " Object ID
            plvar like hrp1000-plvar,      " Plan Version
            istat like hrp1000-istat,      " Planning Status
            begda like hrp1000-begda,      " Begin date
            endda like hrp1000-endda,      " End date
          end of obj_tab.
    Internal Table for Active Employees data PA0000
    data: begin of stat_tab occurs 0,
            pernr like pa0000-pernr,       " Object Type
            begda like pa0000-begda,       " Begin date
            endda like pa0000-endda,       " End date
            stat2 like pa0000-stat2,       " Employment Status
          end of stat_tab.
    Internal Table for Actual Orgn Assignment Data PA0001
    data: begin of act_tab occurs 0,
            pernr like pa0001-pernr,       " Object Type
            begda like pa0001-begda,       " Begin date
            endda like pa0001-endda,       " End date
            kostl like pa0001-kostl,       " Cost Center
            orgeh like pa0001-orgeh,       " Org Unit
            plans like pa0001-plans,       " Position
            natio like pa0002-natio,       " Nationality
          end of act_tab.
    Internal Table for Orgn Data HRP1001
    data: begin of org_tab occurs 0,
            otype like hrp1001-otype,      " Object Type
            objid like hrp1001-objid,      " Object ID
            plvar like hrp1001-plvar,      " Plan Version
            istat like hrp1001-istat,      " Planning Status
            begda like hrp1001-begda,      " Begin date
            endda like hrp1001-endda,      " End date
            subty like hrp1001-subty,      " Sub Type
            sclas like hrp1001-sclas,      " Type of Related Object
            sobid like hrp1001-sobid,      " Id of Related Object
            kostl like pa0001-kostl,       " Cost Center
            plstx like t528t-plstx,        " Position Text
            orgtx like t527x-orgtx,        " Org Unit Text
          end of org_tab.
    Internal Table for Position Calculations
    data: begin of org1_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            objid like hrp1001-objid,      " Object ID
          end of org1_tab.
    Internal Table for Position Calculations
    data: begin of org2_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            count type i,                  " No of Positions
          end of org2_tab.
    Internal Table for Actual Manpower Calculations
    data: begin of act1_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            natio like pa0002-natio,       " Nationality
            plans like pa0001-plans,       " Position
          end of act1_tab.
    Internal Table for Actual Manpower Calculations(UAE)
    data: begin of act2_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            natio like pa0002-natio,       " Nationality
          end of act2_tab.
    Internal Table for Actual Manpower Calculations(Others)
    data: begin of act3_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            natio like pa0002-natio,       " Nationality
          end of act3_tab.
    Internal Table for Actual Manpower Calculations(UAE)
    data: begin of act4_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            count1 type i,                 " No of Positions(UAE)
          end of act4_tab.
    Internal Table for Actual Manpower Calculations(OTHERS)
    data: begin of act5_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            count2 type i,                 " No of Positions(Others)
          end of act5_tab.
    Internal Table for Vaccancies Data
    data: begin of vac_tab occurs 0,
            plvar like hrp1007-plvar,      " Plan Version
            otype like hrp1007-otype,      " Object Type
            objid like hrp1007-objid,      " Object ID
            istat like hrp1007-istat,      " Planning Status
            begda like hrp1007-begda,      " Begin date
            endda like hrp1007-endda,      " End date
            vacan like hrp1007-vacan,      " Vacancy Indicator
            status like hrp1007-status,    " Status of Vacancy
          end of vac_tab.
    Internal Table to store the Report Output data
    data : begin of rep_tab occurs 0 ,
             kostl(10) type n,                  " Cost Cente
             plans   like pa0001-plans,         " Position
             vacan   like hrp1007-vacan,        " Vacancy Indicator
             status  like hrp1007-status,       " Status of Vacancy
             plstx   like t528t-plstx,          " Position Text
             orgtx like t527x-orgtx,            " Org Unit Text
           end of rep_tab.
    Internal Table to store the Report Output data
    data : begin of rep1_tab occurs 0 ,
             kostl(10) type n,                  " Cost Cente
             cnt     type i,                    " No of Vacancies
           end of rep1_tab.
    Internal Table to store the Report Output data
    data : begin of rep2_tab occurs 0 ,
             kostl(10) type n,                  " Cost Cente
             app_no    type i,                  " Approved
             nat_no    type i,                  " National
             exp_no    type i,                  " Expatriate
             tot_no    type i,                  " Total
             vac_no    type i,                  " Vacancies
           end of rep2_tab.
    Declaration of Variables
    data: v_sobid  like hrp1001-sobid,   " Object Id
          v_sobid1 like hrp1001-sobid,   " Object Id
          v_sobid2 like hrp1001-sobid,   " Object Id
          v_sclas  like hrp1001-sclas,   " Related Obj Type
          v_subty  like hrp1001-subty,   " Related Object Id
          v_otype  like hrp1007-otype,   " Object Type
         v_str(9)    type c,            " Text
         v_str1(10)  type c,            " Text
          v_cnt    like sy-tabix.        " Table Index
    Declaration of Constants
    constants : c_x         type c value 'X',            " Flag
                c_stat1  like pa0000-stat2  value '3',   " Emp Status
                c_plan   like hrp1001-plvar value '01',  " Plan Version
                c_name   like hrp1000-uname value 'SAP', " Uname
                c_uae    like pa0002-natio  value 'AE',  " Country
                c_type   like hrp1007-otype  value 'O',  " Object Type
                c_otype  like hrp1007-otype  value 'S',  " Object Type
                c_stat   like hrp1007-status value '0',  " Status
                c_pstat  like hrp1007-istat  value '1',  " Plang Status
                c_sclas  like hrp1001-sclas value 'K',    " Rel. Obj Type
                c_subty  like hrp1001-subty value 'A002', " Related ObjId
                c_subty2 like hrp1001-subty value 'A003', " Related ObjId
                c_sclas1 like hrp1001-sclas value 'O',    " Rel.Obj Type
                c_subty1 like hrp1001-subty value 'A011', " Rel.Object Id
                c_kokrs  like coej-kokrs value '1000'. " Controlling Area
    Selection Screen
    selection-screen begin of block b1 with frame title text-001.
    parameters     :
      p_date  like pa0001-begda obligatory default sy-datum. " Date
    select-options :
      s_kostl for csks-kostl,                     " Cost Center
      s_plans for t528b-plans.                    " Position ID
    selection-screen end of block b1.
    At selection-screen
    at selection-screen.
    Validate the Selection Screen fields
      perform validate_screen.
    Start-of-Selection
    start-of-selection.
    Get the Orgn data from database Table HRP1001
      perform get_org_data.
    Get the Actual Manpower from PA0001
      perform get_act_data.
    Get the Vaccancies data from database Table HRP1007
      perform get_vac_data.
    Append the data into final Internal Table
      perform append_data.
    Top-of-page
    top-of-page.
    Write the Report and Column Headings
      perform top_of_page.
    End-of-Page
    end-of-page.
      write /1(108) sy-uline.
    End-of-Selection
    end-of-selection.
    Display the Output Report.
      perform display_report.
    Form-Routines
    *&      Form  validate_screen
    Validation of selection Screen fields
    form validate_screen.
    Validation of Position ID
      clear t528b.
      if not s_plans[] is initial.
        select single plans
          into t528b-plans
          from t528b
          where plans in s_plans.
        if sy-subrc <> 0.
          message e999 with 'Invalid Position ID'(009).
        endif.
      endif.
    Validation of Cost Center
      clear csks.
      if not s_kostl[] is initial.
        select single kostl
          into csks-kostl
          from csks
          where kostl in s_kostl.
        if sy-subrc <> 0.
          message e999 with 'Invalid Cost Center'(008).
        endif.
      endif.
    endform.                  "validate_screen
    *&      Form  get_org_data
    Get the Orgn Data from Database Table HRP1001
    form get_org_data.
    v_str  = 'Developee'(002).
    v_str1 = 'Deployment'(003).
    Select All the Positions from HRP1000
      select otype       " Object Type
             objid       " Object ID
             plvar       " Plan Version
             istat       " Planning Status
             begda       " Begin date
             endda       " End date
         into table obj_tab
         from hrp1000
         where otype = c_otype  and
               plvar = c_plan   and
               istat = c_pstat  and
               begda le p_date  and
               endda ge p_date  and
               objid in s_plans and
               uname ne c_name.
      sort obj_tab by otype objid.
    Get the Orgn and Cost Center for all the above Positions
      if not obj_tab[] is initial.
        select otype       " Object Type
               objid       " Object ID
               plvar       " Plan Version
               istat       " Planning Status
               begda       " Begin date
               endda       " End date
               subty       " Sub Type
               sclas       " Type of Related Object
               sobid       " Id of Related Object
           into table org_tab
           from hrp1001
           for all entries in obj_tab
           where otype = c_otype  and
                 plvar = c_plan   and
                 istat = c_pstat  and
                 begda le p_date  and
                 endda ge p_date  and
                 sclas eq c_sclas1 and
                 subty eq c_subty2 and
                 objid eq obj_tab-objid.
      endif.
      sort org_tab by otype objid.
    Get the Cost Center
      loop at org_tab.
        v_otype = c_otype.       " S
        v_sclas = c_sclas.       " K
        v_subty = c_subty1.                                     " A011
        v_sobid = org_tab-objid.
        perform get_org using v_otype v_sclas v_subty
                        v_sobid.
        if sy-subrc = 0.
          org_tab-kostl = hrp1001-sobid+0(10).
        else.
          v_otype = c_otype.    " S
          v_sclas = c_sclas1.   " O
          v_subty = c_subty2.                                   " A003
          v_sobid = org_tab-objid.
          perform get_org using v_otype v_sclas v_subty
                         v_sobid.
          if sy-subrc = 0.
            v_otype = c_type.     " O
            v_sclas = c_sclas.    " K
            v_subty = c_subty1.                                 " A011
            v_sobid1 = v_sobid.
            perform get_org using v_otype v_sclas v_subty
                                 v_sobid.
            if sy-subrc <> 0.
              v_otype = c_type.    " O
              v_sclas = c_sclas1.  " O
              v_subty = c_subty.                                " A002
              v_sobid = v_sobid1.
              perform get_org using v_otype v_sclas v_subty
                        v_sobid.
              if sy-subrc = 0.
                v_otype = c_type.   " O
                v_sclas = c_sclas.  " K
                v_subty = c_subty1.                             " A011
                v_sobid2 = v_sobid.
                perform get_org using v_otype v_sclas v_subty
                                 v_sobid.
                if sy-subrc <> 0.
                  v_otype = c_type.   " O
                  v_sclas = c_sclas1. " O
                  v_subty = c_subty.                            " A002
                  v_sobid = v_sobid2.
                  perform get_org using v_otype v_sclas v_subty
                          v_sobid.
                else.
                  org_tab-kostl = hrp1001-sobid+0(10).
                endif.
              endif.
            else.
              org_tab-kostl = hrp1001-sobid+0(10).
            endif.
          else.
            v_otype = c_otype.   " S
            v_sclas = c_otype.   " S
            v_subty = c_subty.                                  " A002
            v_sobid = org_tab-objid.
            perform get_org using v_otype v_sclas v_subty
                           v_sobid.
            if sy-subrc = 0.
              v_otype = c_otype.  " S
              v_sclas = c_sclas.  " K
              v_subty = c_subty1.                               " A011
              v_sobid1 = v_sobid.
              perform get_org using v_otype v_sclas v_subty
                                   v_sobid.
              if sy-subrc <> 0.
                v_otype = c_otype.  " S
                v_sclas = c_sclas1. " O
                v_subty = c_subty2.                             " A003
                v_sobid = v_sobid1.
                perform get_org using v_otype v_sclas v_subty
                          v_sobid.
                if sy-subrc = 0.
                  v_otype = c_type.   " O
                  v_sclas = c_sclas.  " K
                  v_subty = c_subty1.                           " A011
                  v_sobid2 = v_sobid.
                  perform get_org using v_otype v_sclas v_subty
                                   v_sobid.
                  if sy-subrc <> 0.
                    v_otype = c_type.    " O
                    v_sclas = c_sclas1.  " O
                    v_subty = c_subty.                          " A002
                    v_sobid = v_sobid2.
                    perform get_org using v_otype v_sclas v_subty
                            v_sobid.
                  else.
                    org_tab-kostl = hrp1001-sobid+0(10).
                  endif.
                endif.
              else.
                org_tab-kostl = hrp1001-sobid+0(10).
              endif.
            endif.
          endif.
        endif.
    Get the Position Text
        clear t528t.
        select single plstx from t528t into t528t-plstx
          where sprsl = sy-langu and
                otype = c_otype  and
                plans = org_tab-objid.
        org_tab-plstx = t528t-plstx.
    Get the Org Unit Text
        clear t527x.
        select single orgtx from t527x into t527x-orgtx
          where sprsl = sy-langu and
                orgeh = org_tab-sobid+0(8).
        org_tab-orgtx = t527x-orgtx.
        modify org_tab index sy-tabix.
        clear v_sobid.
      endloop.
      sort org_tab by otype objid.
    Calculate the Approved No of Positions
      loop at org_tab.
        if org_tab-kostl in s_kostl.
          move-corresponding org_tab to org1_tab.
          append org1_tab.
          clear org1_tab.
        endif.
      endloop.
      sort org1_tab by kostl objid.
      clear v_cnt.
      loop at org1_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          org2_tab-kostl = org1_tab-kostl.
          org2_tab-count   = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append org2_tab.
          clear:org2_tab.
        endat.
      endloop.
      sort org2_tab by kostl.
    endform.              "get_org_data
    *&      Form  get_act_data
    Get the Actual Manpower Data from Database Table PA0001
    form get_act_data.
      clear  : stat_tab, act_tab.
      refresh: stat_tab, act_tab.
    Get all the Active Employees
      select pernr       " Object Type
             begda       " Begin date
             endda       " End date
             stat2       " Emp Status
           into table stat_tab
           from pa0000
           where stat2 eq c_stat1 and
                 begda le p_date  and
                 endda ge p_date.
      sort act_tab by pernr.
      if not stat_tab[] is initial.
        select pernr       " Object Type
               begda       " Begin date
               endda       " End date
               kostl       " Cost Center
               orgeh       " Org Unit
               plans       " Position
           into table act_tab
           from pa0001
           for all entries in stat_tab
           where pernr eq stat_tab-pernr and
                 kostl in s_kostl and
                 plans in s_plans and
                 persg eq '1'     and
                 begda le p_date  and
                 endda ge p_date.
      endif.
      sort act_tab by pernr.
      loop at act_tab.
        move-corresponding act_tab to act1_tab.
        clear pa0002-natio.
        select single natio into pa0002-natio from pa0002
          where pernr = act_tab-pernr.
        if sy-subrc = 0.
          act1_tab-natio = pa0002-natio.
        endif.
        append act1_tab.
        clear act1_tab.
      endloop.
      sort act1_tab by kostl natio.
    Calculate the Local and Expatriate Manpower
      loop at act1_tab.
        if act1_tab-natio = c_uae.
          act2_tab-kostl = act1_tab-kostl.
          act2_tab-natio = act1_tab-natio.
        else.
          act3_tab-kostl = act1_tab-kostl.
          act3_tab-natio = act1_tab-natio.
        endif.
        append: act2_tab, act3_tab.
        clear : act2_tab,act3_tab.
      endloop.
      sort act2_tab by kostl.
      sort act3_tab by kostl.
    Actual UAE Manpower
      clear v_cnt.
      loop at act2_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          act4_tab-kostl   = act2_tab-kostl.
          act4_tab-count1  = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append act4_tab.
          clear:act4_tab.
        endat.
      endloop.
      sort act4_tab by kostl.
    Other Countries
      clear v_cnt.
      loop at act3_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          act5_tab-kostl   = act3_tab-kostl.
          act5_tab-count2  = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append act5_tab.
          clear:act5_tab.
        endat.
      endloop.
      sort act5_tab by kostl.
    endform.              "get_act_data
    *&      Form  get_org
    Get the Cost Center from Parent Org Id
    form get_org using p_v_otype p_v_sclas p_v_subty p_v_sobid.
      clear hrp1001.
      select single * from hrp1001
            where otype = p_v_otype  and
                  plvar = c_plan   and
                  istat = c_pstat  and
                  begda le p_date  and
                  endda ge p_date  and
                  sclas eq p_v_sclas   and
                  subty eq p_v_subty  and
                  objid eq p_v_sobid.
      v_sobid = hrp1001-sobid+0(8).
    endform.                    " get_org
    *&      Form  get_vac_data
    Get the Vaccancies Data from Database Table HRP1007
    form get_vac_data.
      if not org_tab[] is initial.
        select plvar       " Plan Version
               otype       " Object Type
               objid       " Object ID
               istat       " Planning Status
               begda       " Begin date
               endda       " End date
               vacan       " Vacancy Indicator
               status      " Status of Vacancy
           into table vac_tab
           from hrp1007
           for all entries in org_tab
           where plvar = c_plan   and
                 otype = c_otype  and
                 istat eq c_pstat and
                 objid = org_tab-objid and
                 begda le p_date and
                 endda ge p_date and
                 vacan eq c_x  and
                 status eq c_stat.
      endif.
      sort vac_tab by plvar otype objid.
    Get the HR data into the rep_tab Internal Table
      loop at vac_tab.
        rep_tab-plans  = vac_tab-objid.
        rep_tab-vacan  = vac_tab-vacan.
        rep_tab-status = vac_tab-status.
        read table org_tab with key objid = vac_tab-objid.
        if sy-subrc = 0.
          rep_tab-kostl = org_tab-kostl.
          rep_tab-plstx = org_tab-plstx.
          rep_tab-orgtx = org_tab-orgtx.
        endif.
        append rep_tab.
        clear  rep_tab.
      endloop.
      loop at rep_tab.
        if not rep_tab-kostl in s_kostl.
          delete rep_tab index sy-tabix.
        endif.
      endloop.
      sort rep_tab by kostl plans.
    delete rep_tab where plstx cs v_str.
    delete rep_tab where orgtx cs v_str1.
    Calculate the Count of Vacancies in each Division
      clear v_cnt.
      loop at rep_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          rep1_tab-kostl = rep_tab-kostl.
          rep1_tab-cnt   = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append rep1_tab.
          clear:rep1_tab.
        endat.
      endloop.
      sort rep1_tab by kostl.
    endform.                  "get_vac_data
    *&      Form append_data
    Append the data into final Internal Table
    form append_data.
      loop at org2_tab.
        rep2_tab-kostl = org2_tab-kostl.
        rep2_tab-app_no = org2_tab-count.
        read table act4_tab with key kostl = org2_tab-kostl
                                     binary search.
        if sy-subrc = 0.
          rep2_tab-nat_no = act4_tab-count1.
        endif.
        read table act5_tab with key kostl = org2_tab-kostl
                                     binary search.
        if sy-subrc = 0.
          rep2_tab-exp_no = act5_tab-count2.
        endif.
        read table rep1_tab with key kostl = org2_tab-kostl
                                     binary search.
        if sy-subrc = 0.
          rep2_tab-vac_no = rep1_tab-cnt.
        endif.
        rep2_tab-tot_no = rep2_tab-nat_no + rep2_tab-exp_no.
        append rep2_tab.
        clear rep2_tab.
      endloop.
      sort rep2_tab by kostl.
    endform.             "append_data
    *&      Form  top_of_page
    Write the Report and Column Headings
    form top_of_page.
      skip.
      format color col_heading on.
      write: /1(108) 'NATIONAL DRILLING COMPANY'(010) centered,
             /1(108) 'Summary of Manning Level Report'(011) centered.
      format color off.
      skip.
      write: /2 'Key Date        :'(013), p_date,
             75 'Report Run Date:'(041), sy-datum.
      if not s_kostl[] is initial.
        if s_kostl-high is initial.
          write: /2 'Cost Center     :'(023), s_kostl-low,
                 75 'Time           :'(042), sy-uzeit.
        else.
          write: /2 'Cost Center From:'(024), s_kostl-low+7(3),
                                    'To'(022), s_kostl-high,
                 75 'Time           :'(042), sy-uzeit.
        endif.
      else.
        write: /75  'Time           :'(042), sy-uzeit.
      endif.
      if not s_plans[] is initial.
        if s_plans-high is initial.
          write: /2 'Position Id     :'(019), s_plans-low,
                 75 'User           :'(043), sy-uname.
        else.
          write: /2 'Position Id From:'(021), s_plans-low,
                              'To'(022), s_plans-high,
                 75 'User           :'(043), sy-uname.
        endif.
      else.
        write: /75 'User           :'(043), sy-uname.
      endif.
      write: /75 'Page No        :'(044), sy-pagno.
      skip.
      write /1(108) sy-uline.
      format color col_heading.
      write:/1 sy-vline,
            12 sy-vline, 53 sy-vline,
            64 sy-vline, 65(32)  'Actual'(018) centered,
            97 sy-vline,108 sy-vline.
      write:/1 sy-vline,  2(10) 'CostCenter'(014),
            12 sy-vline, 13(40) 'Description'(026) centered,
            53 sy-vline, 54(10) 'Approved'(025) centered,
            64 sy-vline, 65(32)  sy-uline,
            97 sy-vline, 98(10) 'Vacancies'(017),
           108 sy-vline.
      write:/1 sy-vline,
            12 sy-vline, 53 sy-vline,
            64 sy-vline, 65(10) 'National'(015) centered,
            75 sy-vline, 76(10) 'Expatriate'(020) centered,
            86 sy-vline, 87(10) 'Total'(016) centered,
            97 sy-vline,108 sy-vline.
      format color off.
      write /1(108) sy-uline.
    endform.               "top_of_page
    *&      Form  Display_report
    Write the Report Output
    form display_report.
      if rep2_tab[] is initial.
        message i999 with
        'No Data found for the entered Selection'(035).
      else.
        loop at rep2_tab.
    Authorization Check for the Orgn and Cost Centers
          perform auth_check_org.
          if sy-subrc = 0.
            clear cskt.
            select single ltext into cskt-ltext from cskt
                where spras = sy-langu and
                      kokrs = c_kokrs and
                      kostl = rep2_tab-kostl.
            format color col_normal.
            write: /1 sy-vline, 2(10) rep2_tab-kostl+7(3),
                   12 sy-vline, 13(40) cskt-ltext,
                   53 sy-vline, 54(10) rep2_tab-app_no,
                   64 sy-vline, 65(10) rep2_tab-nat_no,
                   75 sy-vline, 76(10) rep2_tab-exp_no,
                   86 sy-vline, 87(10) rep2_tab-tot_no,
                   97 sy-vline, 98(10) rep2_tab-vac_no,
                  108 sy-vline.
            format color off.
            at last.
              sum.
              format color 3.
              write /1(108) sy-uline.
              write: /1 sy-vline, 2(10) 'Total'(027),
                     12 sy-vline,
                     53 sy-vline, 54(10) rep2_tab-app_no,
                     64 sy-vline, 65(10) rep2_tab-nat_no,
                     75 sy-vline, 76(10) rep2_tab-exp_no,
                     86 sy-vline, 87(10) rep2_tab-tot_no,
                     97 sy-vline, 98(10) rep2_tab-vac_no,
                    108 sy-vline.
              format color off.
            endat.
          endif.
        endloop.
      endif.
      write /1(108) sy-uline.
    endform.                    " Display_report
    *&      Form  auth_check_org
    Authorization Check for the Orgn and Cost Center
    form auth_check_org.
      authority-check object 'ZNDCHROM'
            id 'PLVAR' dummy
            id 'OTYPE' dummy
            id 'KOSTL' field rep2_tab-kostl.
    endform.                  "auth_check_org
    Reward points for useful Answers
    Regards
    Anji

  • ABAP Unicode issue...

    ABAP gurus,
    We are in the process of upgrading our SAP from 4.6C to ECC 6.0. I am trying to pass some of the programs from UCCHECK. I got following exceptions:
    "XK_HEX00" must be a character-type data object (data type C, N, D, T or STRING)
    "XK_HEX09" must be a character-type data object (data type C, N, D, T or STRING)
    "XK_HEXLF" must be a character-type data object (data type C, N, D, T or STRING)
    We have following statements in the program:
          xk_hex00(1)   type x value '00',      "binaer null
          xk_hex09(1)   type x value '09',      "Steuerzeichen Tabulator
          xk_hexcr(1)   type x value '0D',      "Steuerzeichen CR
          xk_hexlf(1)   type x value '0A',      "Steuerzeichen LF
    Please help.
    Thanks.
    Rajesh.

    Please help how to convert hexadecimal values '00', '09', '0D' and '0A' in type C for unicode validation. I know there is a class called CL_ABAP_CHAR_UTILITIES. But I don't know what attribute to use for what ?
    Thanks.
    Regards,
    Rajesh.

  • ABAP SQL Doubt

    Hi ABAP Gurus,
    Please help me in solving following ABAP SQL doubt.
    In the table Zonfig there are two fields: FNAME and REQFLAG
    FNAME.....REQFLAG
    S1...........X
    S2...........X
    S3..........._
    S4...........X
    Other table T_Zconfig has one field : XNAME
    XNAME
    S1
    S3
    Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.
    That is in this case for FNAME S1 and S2 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S2.
    Points will be surly awarded...
    Thanks.

    Hi ABAP Gurus,
    Please help me in solving following ABAP SQL doubt.
    In the table Zonfig there are two fields: FNAME and REQFLAG
    FNAME.....REQFLAG
    S1...........X
    S2...........X
    S3..........._
    S4...........X
    Other table T_Zconfig has one field : XNAME
    XNAME
    S1
    S3
    Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.
    That is in this case for FNAME S1 and S3 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S3.
    Points will be surly awarded...
    Thanks.

Maybe you are looking for