Scale selection to document height, and center on width+height of page

Hi there
I've got little experince with ID-scripting. Can anyone help me out here? It should be really simple
What I'm doing now is pasting my graphics and then check the doc height in the 'Document Setup' and type the doc height in mm in the scale-height field. (Not the height field, 'caus i want it all of my selection to scale evenly!)
Then i center horizontaly and verticaly.
Shouldn't this be easy to script? I hope so. Thx!

Ok. Try now,
var doc = app.activeDocument, 
    sel = app.selection[0], 
    w = doc.documentPreferences.pageWidth, 
    h = doc.documentPreferences.pageHeight; 
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS; 
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS; 
doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
var currscale = sel.verticalScale; 
    selheight = sel.geometricBounds[2]-sel.geometricBounds[0], 
    selwidth = sel.geometricBounds[3]-sel.geometricBounds[1], 
sel.verticalScale = (((h - selheight)/selheight) * currscale) + currscale;
sel.move([(w-selwidth)/2,0]);
Regards,
Chinna

Similar Messages

  • When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    Skimming the templates in the Template Chooser shows you all of the pages available in the template once you open it. You can insert the one(s) you want, even more than one of any of them. Most users don't want or need all of the different pages, especially when they start the document.

  • Selecting from one table and Update another in the same Page

    Could someone help me with this HTMLDB task. In my page design, I am selecting data from two tables (masters: DEPT, EMP) which I want to display on the left column of the page and at the same time a user would be able to update another table (ATTENDANCE:with many children) which would have a radiogroup on the right side for each value of the master such as employee name. The placement of data has to appear in corresponding rows on the page. For instance, employee names of the master table must appear on the same row with its corresponding child value. The page would be grouped by DEPT_NO. The user would click on the department name, a new page with the employee name would apprar. From that page, the user would then update attendance column for each employee in that department. In this operation, it is only the ATTENDANCE table that is being updated. I can send out more information about the structure of the tables if you need more information. I tried many HTMLDB options, forms, reports, etc. I have not been able to get quite right. Your help will be appreciated.

    Raju,
    Thanks for responding to my problem. I have actually tried using the example on how-to you sent me a link to but it did not help as I expected. You see, the page would be updated every meeting date for each employee. I can send you more information about the table structure if you like. However, let me see if this will help you a bit.
    Tables are: 1) Dept [dept_no (pk),dept_name] 2) EMP [emp_no (pk),emp_name, dept_no(fk)] 3) Meetings [meet_key(pk),attended, meeting_date, emp_no(fk)]
    What I want to do is create two pages, one would list the departments, when a user selects a department, the user would be linked to a meeting attandance page. The meeting attendance page would list department name once, Meeting date once, and then list employees in that department. At the right column of every employee would be a checkbox for meeting.attended for update. The meeting_date would be pre-populated so that what the user would do is just check Yes/NO. The second page is the one I'm having the most problem with.
    If I can do a fetch from dept, emp, and meetings and then do an update on the Meetings table on the same page, I think that might solve the problem. That was how I solved it in MS Access three years ago.
    Here is email address in case you want to contact me directly. [email protected]
    Thanks again for your help.

  • When attempting to "save as" a word document and selecting micrsoft word as the "save as type", it no longer will save it in a word icon document, the icon is just a blank document symbol and thus cannot email this document as before.

    when attempting to "save as" a word document and selecting micrsoft word as the "save as type", it no longer will save it in a word icon document, the icon is just a blank document symbol and thus cannot email this document

    Here are my two cents.
    The resources defining the file formats which Pages may import or export are stored in the file :
    Macintosh HD:Applications:iWork '09:Pages.app:Contents:Info.plist
    Assuming that you didn't installed the Developer tools, go to my iDisk (address below)
    Download :
    Pref Setter.app.zip
    Unpack the archive.
    Open the file "Info.plist" with Pref Setter.
    Open the entry entitled :  CFBundleDocumentsTypes
    Open the items 9, 10, 11, 12
    The normal contents is :
    Double check the parameters available for items 9 & 10.
    What you get may be linked to some oddity in these resources.
    Yvan KOENIG (VALLAURIS, France) samedi 1 octobre 2011 18:00:23
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • After aborted rebuild in Mail: I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up

    I have searched quite a bit to find a resolution to this problem, with no success. Any help would be appreciated.
    I decided to rebuild my inboxes by following this advice: http://support.apple.com/kb/PH11704. The rebuild took several hours and at 96% (4 minutes remaining apparently), the indexing froze (that is, after 8 hours, the message was still telling me "4 minutes left"). I forced quit mail, restored the previous Envelope files from the trash, and everything seemed fine.
    However, since this failed attempt, I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up. All messages in my various inboxes have the reloading problem, EXCEPT messages that I downloaded since the aborted rebuild (in other words, there are about 40 messages that I downloaded since I tried the rebuild and I have no problem with these). The other 70,000 messages however wont load, even though I can see them in the centre pane and spotlight has no problem finding them and showing me their contents (when I hover the mouse over the message). When I click on the message in spotlight, mail opens and the loading problem re-occurs.
    Since then, based on various suggestions I found for similar issues, I have used Disk Utility to verify and repair permissions and the drive. I used Onix to rebuild the Mail index (that only took about a minute - I am not sure how to interpret this when compared to the hours the rebuild took with Mail). No joy, I still have the same problem. I even restored one of my inboxes via Time Machine and the same issue with loading continues.
    I am using ML 10.8.2. I have a combination of IMAP accounts (work) and POP accounts (personal). The issue of loading occurs irrespective of the account.
    I am baffled and am now considering migrating to either Thunderbird or Postbox 3 to try and solve my problem. I prefer to stay with Mail. I should note also that I am using MailTags with Mail (http://www.indev.ca/MailTags.html), although I have not used any of the features. I upgraded to ML from SL about 2 weeks ago. It was very smooth and there appear to be no issues (not sure how helpful this is and probably not at all related to this issue).
    Any suggestions much appreciated!

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • If I have a document that is 10 pages and I only want to print pages 2.4.6 how can i select just those. The selection button is grayed out

    i want to print only selected pages not the whole document.. HELP

    Firefox allows printing of a'' range of pages'', for example, page 2 to 5. But not a non-contiguous set of pages.
    Firefox allows you to print a ''selection'', but by that Firefox means the part of the page you selected with the mouse or keyboard, so again, a continuous range.
    If you don't want to print 3 times, I suggest using a PDF printer driver as an intermediary. Then you can print any individual pages you like using the much more full-featured print dialog in Adobe Reader or Adobe Acrobat.
    If you do not have one, here are two free PDF printer drivers I have used:
    * PrimoPDF - http://www.primopdf.com/
    * PDF Creator - http://www.pdfforge.org/pdfcreator
    If you are just printing for quick reference and don't mind a "trial edition" banner on your PDF, I really like this one due to its handy preview-before-save feature:
    * pdfFactory - http://fineprint.com/pdf/

  • Finished my composition but it's too big, I need to scale to a fixed height and width - help?

    Hi everyone,
    This is quite urgent - I've finished my project in Edge Animate, but it is too large and needs to be scaled down. I tried to place it in a separate DIV element in the HTML and scale it down with the CSS but this doesn't work.
    I want to scale it from the 1024px wide it currently is down to a fixed width of 800px. Can anyone help me do this? All of the tutorials I have found are to do with making the composition responsive to the user resizing the browser, and this isn't what I need at the moment.
    Any help would be greatly appreciated! Thanks!

    Can you explain a bit further what you need this for? Are you just trying to center the Stage on your page?
    Asking because when writing out this script I ran into some weird browser issues setting the transform origin to the center (IE and FF IIRC). You can give it a shot though by changing the transform origin in the code to:
    “transform-origin”:”50% 0″, (for all prefixed instances)
    Not guaranteeing results, but you can try
    Sarah

  • Trying to print a document from Pages, when I go to print it won't let me select the document.  It is grey and I can't click it.  What should I do?

    Trying to print a document from Pages, when I go to print it won't let me select the document.  It is grey and I can't click it.  What should I do?

    I'm not clear on how you're trying to print. When you select Print from the file menu in Pages the current document is already selected. Perhaps you need to show the details in the print dialog. The first screenshot is from Mountain Lion the second from an earlier OS where you click the blue down-facing triangle button (sorry, I can't remember which one).

  • Change the Accounting document fields cost center and profit center

    Dear Experts,
    User has posted document with wrong profit center
    For that we subjected that he can go to the profit center actual posting T.Code 9ke0 but with that he can only change the Profit center document with that there is no accounting side updating
    I have tried with Document Change Rules, Line Item for fields cost center and profit center  in that while configuring I did not get any error message,
    But in the document I am unable to changing the same fields cost center and profit center  
    Can any body please guide me to resolve the issue?
    Essentially I want to change the Accounting document fields cost center and profit center   
    Thanks in Advance,
    Wiswanath

    Hello,
    Once the documents are posted in FI module, the system doesn't allow anybody to change the cost objects (cost center, profit center, internal order). The only fields you can change through FB02 transaction are the Line item text (BSEG-SGTXT) and the assignment (BSEG-ZUONR).
    If you want to get a change to the cost object to be reflected from FI to CO, you should reverse the FI documents with wrong cost objects and post new documents with correct cost center, profit center.
    Hope it helps you.
    Cheers,
    Daniel.

  • Resize a layer to a percentage of the document size and position in corner

    I need to create a script that places a logo in the corner of my main document but i need the logo to be constrained to a percentage of the document size. my logos needs to live in the bottom right corner of my images and be no larger than 28 percent height and no larger than 60 percent of the width of the document. i need it to constrain proportions of the original file so if the logo is square it will remain square, or if it is more rectangular it will maintain its rectangular shape.  Heres what i've come up with so far, i am pretty inept at scripting so if disregarding my current script is more helpful than building upon it please ignore mine:
    if ( documents.length > 0 )
        var originalDialogMode = app.displayDialogs;
        app.displayDialogs = DialogModes.ERROR;
        var originalRulerUnits = preferences.rulerUnits;
        preferences.rulerUnits = Units.PIXELS;
        try
            app.activeDocument = app.documents[0];    //set active document to 2nd document   
            var docRefOne = app.documents[0];
            var refWidth = docRefOne.width;
            var refHeight = docRefOne.height;
            app.activeDocument = app.documents[1];    //set active document to 2nd document   
             var docRef = activeDocument;
            //current image dimensions
            var w = docRef.width;
            var h = docRef.height;
            activeDocument.selection.selectAll();
            docRef.selection.copy();   //Copy selection
            app.activeDocument = app.documents[0]; //set first document as active document
            var docRef = activeDocument;
            activeDocument.selection.selectAll();
           docRef.paste(true); //paste into selection
        catch( e )
        // An error occurred. Restore ruler units, then propagate the error back
            // to the user
            preferences.rulerUnits = originalRulerUnits;
           app.displayDialogs = originalDialogMode;
            throw e;
        // Everything went Ok. Restore ruler units
        preferences.rulerUnits = originalRulerUnits;
        app.displayDialogs = originalDialogMode;

    You could do something like this...
    #target photoshop
    activeDocument.suspendHistory('Logo Resize', 'main()');
    function main(){
    if(!documents.length) return;
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var myDoc = activeDocument;
    /////////////////////////////// Amend to suit /////////////////////////////////
    var Opacity = 100; /* Opacity of logo */
    //Position logo   X,Y
    var X = myDoc.width - 10; //Right side of logo
    var Y = myDoc.height - 10; //Bottom of logo
    var Logo = File(Folder.desktop + "/logo.png"); //logo
    if(!Logo.exists){
        alert("Your logo '" + decodeURI(Logo.name) + "' does not exist!");
        app.preferences.rulerUnits = startRulerUnits;
        return;
    placeFile(Logo);
    var LB = myDoc.activeLayer.bounds;
    var docHeight = myDoc.height;
    var docWidth = myDoc.width;
    var LHeight = Math.abs(LB[3].value) - Math.abs(LB[1].value);
    var LWidth = Math.abs(LB[2].value) - Math.abs(LB[0].value);  
    if(LWidth > LHeight) {//Landscape logo
    var Percent = 60; /* Resize logo to percentage of smallest side of doc */
    if(LWidth < LHeight) {//Portrait logo
    var Percent = 28; /* Resize logo to percentage of smallest side of doc */
    if(LWidth == LHeight) {//Square logo
    var Percent = 15; /* Resize logo to percentage of smallest side of doc */
    var percentageHeight = ((docHeight/LWidth)*Percent);
    var percentageWidth = ((docWidth/LWidth)*Percent);
    if(docWidth < docHeight){
    myDoc.activeLayer.resize(percentageWidth,percentageWidth,AnchorPosition.MIDDLECENTER);
    }else{  
      myDoc.activeLayer.resize(percentageHeight,percentageHeight,AnchorPosition.MIDDLECENTER);
    var LB = myDoc.activeLayer.bounds;
    X = X - LB[2].value;
    Y = Y - LB[3].value;
    activeDocument.activeLayer.translate(X,Y);
    activeDocument.activeLayer.opacity=Opacity;
    app.preferences.rulerUnits = startRulerUnits;
    function placeFile(placeFile) {
    var desc = new ActionDescriptor();
    desc.putPath( charIDToTypeID('null'), new File(placeFile) );
    desc.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') );
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 );
    desc2.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 );
    desc.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc2 );
    try{
    executeAction( charIDToTypeID('Plc '), desc, DialogModes.NO );
    }catch(e){}

  • I have an Adobe Flash Professionals digital classroom book for CS6 and was following all steps easily until it ask me to select the text tool and change it from classic to tfl in the property inspector. I looked and all that drops down is dynamic, static,

    I have an Adobe Flash Professionals digital classroom book and was following all steps easily until it ask me to select the text tool and change it from classic to tfl in the property inspector. I looked and all that drops down is dynamic, static, and input. Where is the TFL and Classic ? I watched adobe learning center but he was using CS5. Can anyone please help?

    Hi,
    Do you use Flash CS6 to follow the instructions in the classroom book? If yes, then you can find it under text drop down for an AS3 Document as shown below
    If you follow the instruction in Flash CC or Flash CC2014 then you will not find this option as this is deprecated.
    Thanks!
    Mohan

  • Scale selected objects

    Hi guys
    I would like to know if there's an easy way for this situation:
    I have 5 rectangles of the same size placed on different locations on my spreadsheet. Is there an easy way to scale them all to the same width or height by selecting them all and giving in the measurements? The main goal is that I don't have to select them each apart and give in the measurements 5 time, but also that I don't need to put them back on their location?
    Do you understand what I mean?
    Many thanks
    Bob

    Not quite all at once, but for objects on the same spread you can select and transform one, then select the rest, Object > Transform Again > Transform Sequence Again Indiviually. If you don't do anything else in between it amy also work if you change spreads and select new objects.

  • How to read excel file in document library and store excel content in sql table

    Hello,
    Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
    Please let me know the ways to acheive this. Feel free to give your suggestions.
    Thanks,
    Cool Developer

    Hi!
    this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
    System.Data.OleDb.
    OleDbConnection ExcelConnection = null;
    FileMode fileMode;
    string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
    using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
    using (SPWeb _web = _site.OpenWeb())
    string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
    SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
    fileMode =
    FileMode.Create;
    byte[] byteArray = _file.OpenBinary();
    MemoryStream dataStream = new MemoryStream(byteArray);
    Stream stream = dataStream;
    using (FileStream fs = File.Open(filePath, fileMode))
    byte[] buffer = new byte[4096];
    int bytesRead;
    while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
    fs.Write(buffer, 0, bytesRead);
    fs.Close();
    //Create the Connection String
    try
    string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
    Data Source ='"
    + filePath + "'; Extended Properties=Excel 5.0";
    //Create the connection
    ExcelConnection =
    new System.Data.OleDb.OleDbConnection(ConnectionString);
    //create a string for the query
    string ExcelQuery;
    //Sheet1 is the sheet name
    //create the query:
    //read columns from the Excel file
    ExcelQuery =
    "Select * from [Sheet1$]"; // from Sheet1";
    //use "Select * ... " to select the entire sheet
    //create the command
    System.Data.OleDb.
    OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
    //Open the connection
    ExcelConnection.Open();
    //Create a reader
    System.Data.OleDb.
    OleDbDataReader ExcelReader;
    ExcelReader = ExcelCommand.ExecuteReader();
    //For each row after the first
    while (ExcelReader.Read())
    thanks,
    kshitij

  • Regarding : Material document data and PO data do not match (Plant)

    Hi Gurus,
    Please go through this BAPI program.
    While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
    Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
    dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
    DATA: BEGIN OF it_itab OCCURS 100,
          docdate(10),
          postdate(10),
          mvt_type(3), "Movement Type
          plant(4), "Plant
          lgort(4),
          pur_doc(10), "Purchase Document No
          po_item(3), "Purchase Document Item No
          material(18), "Material Number
         delnote(16),
          erfmg(13),
          uom(3),
         lfmng(13), "Quantity
          batch(10) TYPE c,
          vfdat TYPE vfdat,
          END OF it_itab.
    DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01      INITIAL SIZE 100,
          it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code         INITIAL SIZE 100,
          it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create  INITIAL SIZE 100.
    DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
          wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
          wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
    DATA: w_mat_doc  TYPE bapi2017_gm_head_ret-mat_doc,
          w_year     TYPE bapi2017_gm_head_ret-doc_year.
    DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF it_errmsg_goodsmvt.
    DATA : obj_type LIKE bapiache09-obj_type,
           obj_key  LIKE bapiache09-obj_key,
           obj_sys  LIKE bapiache09-obj_sys.
    DATA: v_date1 TYPE sy-datum.
    DATA: v_date2 TYPE sy-datum.
    DATA: w_lines TYPE i.
    DATA: errflag.
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK bk1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    Start-of-selection processing
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header        = 'X'
          i_tab_raw_data       = i_excel
          i_filename           = p_file
        TABLES
          i_tab_converted_data = it_itab[]
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT it_itab.
        REFRESH it_goodsmvt_head.
        REFRESH it_goodsmvt_item.
        CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
        CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
        wa_goodsmvt_head-pstng_date = v_date2.
        wa_goodsmvt_head-doc_date   = v_date1.
       wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
    wa_goodsmvt_head-pr_uname   = sy-uname.
        APPEND wa_goodsmvt_head TO it_goodsmvt_head.
    Maintain it_goodsmvt_code
        wa_goodsmvt_code-gm_code    = '04'.
    Maintain it_goodsmvt_item
    *LOOP AT it_itab.
    IF wa_goodsmvt_item-po_number IS INITIAL.
        wa_goodsmvt_item-po_number    = it_itab-pur_doc.
        wa_goodsmvt_item-move_type    = it_itab-mvt_type.
        wa_goodsmvt_item-MOVE_PLANT      = it_itab-plant.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = it_itab-material
          IMPORTING
            output = it_itab-material.
        wa_goodsmvt_item-material     = it_itab-material.
        wa_goodsmvt_item-stge_loc     = it_itab-lgort.
        wa_goodsmvt_item-po_item      = it_itab-po_item.
        wa_goodsmvt_item-entry_qnt    = it_itab-erfmg.
        wa_goodsmvt_item-ENTRY_UOM_ISO    = it_itab-uom.
       wa_goodsmvt_item-po_pr_qnt    = it_itab-lfmng.
        wa_goodsmvt_item-batch        = it_itab-batch.
        wa_goodsmvt_item-expirydate   = it_itab-vfdat.
       wa_goodsmvt_item-NO_MORE_GR   = 'X'.
        wa_goodsmvt_item-mvt_ind      = 'B'.
        APPEND wa_goodsmvt_item TO it_goodsmvt_item.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header  = wa_goodsmvt_head
            goodsmvt_code    = wa_goodsmvt_code
          IMPORTING
            materialdocument = w_mat_doc
          TABLES
            goodsmvt_item    = it_goodsmvt_item
            return           = it_errmsg_goodsmvt.
    Process of commit work
        IF it_goodsmvt_head[] IS NOT INITIAL.
          DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
        ENDIF.
        IF it_goodsmvt_item[] IS NOT INITIAL.
          DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
        IMPORTING
        RETURN        =
          CLEAR errflag.
          READ TABLE it_errmsg_goodsmvt INDEX 1.
          IF it_errmsg_goodsmvt-type EQ 'E'.
            WRITE:/'Error in function', it_errmsg_goodsmvt-message.
            errflag = 'X'.
          ELSE.
            WRITE:/ it_errmsg_goodsmvt-message.
          ENDIF.
          IF errflag IS INITIAL.
            COMMIT WORK AND WAIT.
            IF sy-subrc NE 0.
              WRITE:/ 'Error in updating'.
              EXIT.
            ELSE.
              WRITE:/ 'Material Document created successfully and the Document Number for the Material',
                      wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.

    Hey,
    Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
    Mine is solved....
    Thanks

  • G/L Document Comparing and Posting

    I am developed a ALV report, wherein the requirement is i have many columns but out of which i have 3 major columns, 1 column is for Invoice Amount(wherein i am able to pick the wrbtr data of bseg) and 2nd colums is pmt made by customer(editable column) and 3rd is pending payment(1st col-2nd column).
    This report is basically for collection recevied from customer, when end user enters the data in pmt recvd then automatically my 3rd colm is getting updated. For doing this i have created a button on application toolbar "POSTING" . so that when user selects rows from alv and clicks on POSTING button then the contents of these rows will go and fit into the F-28, for this i have recorded F-28 and here in f-28, the document number column is a read only column in table control, here i need to compare document number(selected from row) and document number of F-28 for correctly posting the payments like Complete Payment, Partial Payment and Residual Payment. But i could not able to do so? I am not able to compare selected row belnr with table control belnr (RFOPS_DK-BELNR) as this is a strucutre and no non-editable field.
    Secondly, if i am trying to post the document through BAPI_ACC_DOCUMENT_POST, i am getting the following error.
    E - RW - 609 - Error in document: BKPFF $ PEDCLNT710
    E - RW - 014 - FI/CO interface: Line item entered several times.
    However, in HEADER i am entering OBJ_TYPE = BKPFF, OBJ_KEY = $ AND OBJ_SYS = PDCLNT710
    Can any experts, who has already faced such issues can post the solution. <removed by moderator>
    In Adv Thanks
    A Sustainer
    Edited by: Thomas Zloch on Sep 9, 2011 7:32 PM

    HI Max, I am using the following code.
    REPORT  ZRFBIBL00.
    PARAMETERS: p_mode TYPE char01 DEFAULT 'A',
    p_bukrs TYPE bkpf-bukrs,
    p_kunnr TYPE kna1-kunnr,
    p_doc1 TYPE bkpf-belnr,
    p_doc2 TYPE bkpf-belnr.
    CALL FUNCTION 'POSTING_INTERFACE_START'
    EXPORTING
    I_CLIENT = SY-MANDT
    i_function = 'C'
    I_GROUP = ' '
    I_HOLDDATE = ' '
    I_KEEP = ' '
    I_MODE = p_mode
    I_UPDATE = 'S'
    I_USER = sy-uname
    I_XBDCC = ' '
    EXCEPTIONS
    CLIENT_INCORRECT = 1
    FUNCTION_INVALID = 2
    GROUP_NAME_MISSING = 3
    MODE_INVALID = 4
    UPDATE_INVALID = 5
    OTHERS = 6.
    IF sy-subrc NE 0.
    EXIT.
    ENDIF.
    DATA: l_auglv TYPE T041A-AUGLV VALUE 'EINGZAHL', "Posting with Clearing
    l_tcode TYPE sy-tcode VALUE 'FB05', "You get an error with any other value
    l_sgfunct TYPE RFIPI-SGFUNCT VALUE 'C'. "Post immediately
    DATA: lt_blntab TYPE STANDARD TABLE OF BLNTAB WITH HEADER LINE,
          lt_ftclear TYPE STANDARD TABLE OF ftclear WITH HEADER LINE,
          lt_ftpost TYPE STANDARD TABLE OF ftpost WITH HEADER LINE,
          lt_fttax TYPE STANDARD TABLE OF fttax WITH HEADER LINE.
    Batch Input Values
    lt_ftpost-stype = 'K'."Header
    lt_ftpost-count = 1. "number of Dynpro
    lt_ftpost-fnam = 'BKPF-BLDAT'.
    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum(4) INTO lt_ftpost-fval SEPARATED BY '.'.
    APPEND lt_ftpost.
    lt_ftpost-fnam = 'BKPF-BUDAT'.
    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum(4) INTO lt_ftpost-fval SEPARATED BY '.'.
    APPEND lt_ftpost.
    lt_ftpost-fnam = 'BKPF-BLART'.
    lt_ftpost-fval = 'DA'. "Same type as documents cleared via F-32
    APPEND lt_ftpost.
    lt_ftpost-fnam = 'BSEG-BETRG'.
    lt_ftpost-fval = '7000'.
    append lt_ftpost.
    *lt_ftpost-fnam = 'RF05A-NEWBS'.
    *lt_ftpost-fval = 40.
    *APPEND lt_ftpost.
    *lt_ftpost-fnam = 'RF05A-NEWKO'.
    *lt_ftpost-fval = 208024.
    *APPEND lt_ftpost.
    Documents to be cleared
    lt_ftclear-agkoa = 'D'. "Account Type
    lt_ftclear-xnops = 'X'. "Indicator: Select only open items which are not special G/L?
    lt_ftclear-agbuk = p_bukrs. "Example company code
    lt_ftclear-agkon = p_kunnr. "Example Customer
    lt_ftclear-selfd = 'BELNR'."Selection Field
    lt_ftclear-selvon = p_doc1.
    lt_ftclear-selbis = p_doc1.
    APPEND lt_ftclear.
    lt_ftclear-selvon = p_doc2.
    lt_ftclear-selbis = p_doc2.
    APPEND lt_ftclear.
    CALL FUNCTION 'POSTING_INTERFACE_CLEARING'
    EXPORTING
    i_auglv = l_auglv
    i_tcode = l_tcode
    I_SGFUNCT = l_sgfunct
    I_NO_AUTH = ' '
    IMPORTING
    E_MSGID =
    E_MSGNO =
    E_MSGTY =
    E_MSGV1 =
    E_MSGV2 =
    E_MSGV3 =
    E_MSGV4 =
    E_SUBRC =
    tables
    t_blntab = lt_blntab
    t_ftclear = lt_ftclear
    t_ftpost = lt_ftpost
    t_fttax = lt_fttax
    EXCEPTIONS
    CLEARING_PROCEDURE_INVALID = 1
    CLEARING_PROCEDURE_MISSING = 2
    TABLE_T041A_EMPTY = 3
    TRANSACTION_CODE_INVALID = 4
    AMOUNT_FORMAT_ERROR = 5
    TOO_MANY_LINE_ITEMS = 6
    COMPANY_CODE_INVALID = 7
    SCREEN_NOT_FOUND = 8
    NO_AUTHORIZATION = 9
    OTHERS = 10.
    IF sy-subrc NE 0.
    RETURN.
    ENDIF.
    CALL FUNCTION 'POSTING_INTERFACE_END'
    EXPORTING
    I_BDCIMMED = 'X'
    I_BDCSTRTDT = NO_DATE
    I_BDCSTRTTM = NO_TIME
    EXCEPTIONS
    SESSION_NOT_PROCESSABLE = 1
    OTHERS = 2.
    IF sy-subrc NE 0.
    RETURN.
    ENDIF.
    But in the above code, i am not able to pass the Amount for a particular document, Could you please let me know from the following tables, which table field can carry the amount for a document, which i passing from my alv report, which then decide whether its complete payment, partial amount or residual payment by comparing the amount of my alv report with the amount of the document (f-28) screen.
    t_blntab
    t_ftclea
    t_ftpost
    t_fttax
    Will be very thankful, if you revert.
    Thanks,
    A Sustainer

Maybe you are looking for

  • [solved] Blank screen for few seconds between GDM and Gnome-Shell

    Hi there, I don't know if this phenomenon is "normal" or not, so I ask : I am using Gnome 3.6 and after I have logged in on GDM I see a blank screen for roundabout 3 seconds before the gnome-shell starts. The whole system is running fine - so this is

  • Crystal Reports and BillQuick

    I am having problems connecting BillQuick and Crystal Reports. I am fairly new to both programs. I have gone through the Crystal Reports tutorial and I am confident that once I have the data, I will be able to create the report I want. Can anyone off

  • Content Player showing the error Not ok!

    Hi All, Here we configured learning solution on Portal and given all permissions to the folder where the SCORM content placed and given SAP_ALL permision to the user . But while testing the content player by the url /lms/mediator/config it is giving

  • How do I traverse up a XML data set tree?

    This seems like it would be really simple, but I'm not sure how to do it. Basically, given a dataset with a single element, how do I output all of its parents? I can't find anything in the API descriptions about how to traverse through the parents. A

  • Delegation in MSS

    Is there a prefered way to setup delegation in MSS?  Looking for recommended procedures/guidelines. I am on ESS/MSS 1.0 EP7. thanks James