Changing filename of attachment using GOS

Hi Gurus ,
I am in the middle of the technical issue related to the  GOS_EXECUTE_SERVICE function module.
Everything is working fine but when i am attaching a file from my pc, it's taking the filename as it is. it sounds good.
But here comes the problem, i have a requirement of adding the filename starting with a common name.
Suppose i have attached a file and it's name is abc.pdf but i want to display it as zbp_abc.pdf.
Thanks and Regards.
Dhananjay

Hi Himanshu,
Thanks for your first reply
I have used this function module.
CONCATENATE ls_final-pernr ls_final-reinr INTO
         ls_object-objkey.
         ls_object-objtype = 'BUS2089'.
         CALL FUNCTION 'GOS_EXECUTE_SERVICE'
           EXPORTING
             ip_service           = 'VIEW_ATTA'
             is_object            = ls_object
             ip_no_commit         = ' '
             ip_popup             = 'X'
             ip_rwmod             = 'E'
*           IT_SERVICE_SELECTION =
*           IP_VSI_PROFILE       =
           IMPORTING
             ep_event             = lp_event
             ep_status            = lp_status
             ep_icon              = lp_icon
             ep_message           = lp_message
           EXCEPTIONS
             execution_failed     = 1
             OTHERS               = 2.
It's working great. but i want to add a prefix before the file name. means after saving the file it must look like tv_abc.pdf and not like abc.pdf.
But file which i have selected from desktop is abc.pdf and after attaching it looks like tv_abc.pdf on screen.
Thanks in advance.
Regards
Dhananjay

Similar Messages

  • Uploading attachment using GOS for XK02/XK03

    Hi All,
    i am trying to upload the attachments to XK02(or XK03) for a corresponding vendors using GOS.
    i have no idea how to do this.
    plz help me...
    thanks in advance.

    hi Surinder.
    thanks for the link that was very help full.
    but i need to upload the attachments through a program.
    and the thing is BDC will not work in this case
    do you know any other way to upload these attachements like using RFC's ?

  • Mail receiver adapter: change filename of attachment to number in payload.

    Dear experts,
    I want to send out Purchase Orders from XI to a email address. The XI message containing the Purchase Order is sent as an attachment to a email to the supplier. However, the filename of the attachment needs to unique. Preferably the PO number which is in the file content.
    Can anybody help me out with how to accomplish this?
    My current settings are:
    Transport protocol: SMTP
    Message Protocol: XIPAYLOAD
    Not using mail package
    Keeping attachments.
    Using: MessageTransformBean
    Transform.ContentDisposition --> attachment;filename="testing.xml"
    Please tell me how to dynamically change the "testing.xml" part!
    Thanks in advance,
    *will reward points if helpful

    Thanks Prateek!
    This is what I was looking for.
    Can you please do me one more favour?
    How to include this code in the module? I have been looking on help.sap.com but only found to be able to do this in PCK. Is this correct?
    How can I use the code?
    Thanks in advance.

  • Create attachment using GOS

    Hi All,
    I am working in SAP GTS (Global trade service) project.
    My requirement is to attach a document (doc, pdf, xls, jpeg) to the customs declaration document.
    I had to do this via a report program. This program will run every night. It will attach the document for the document number created for the day.
    How do I proceed....
    I read some threads relating to this requirement, but I do I implement it in a program...
    1. First I had to do the attachment
    2. I had to link the attachment to the document no
    How to proceed... please help......

    Actually it appears that I do not have access to the system at the moment, if you send me an email(on my business card) I can get it to you in the morning.
    Also,if you are interested, the code within this function module uses alot of the code seen here, just modified to upload from a filepath/filename.
    /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
    REgards,
    RIch Heilman

  • Creating Attachment using GOS

    Hi All,
    I am developing a module pool program which involves two screens 0100 and 0200.
    0100 is my entry screen. I need to display the GOS toolbar on screen 0200. So I have done the coding in PBO of screen 0200.
    But when I am again calling screen 0100 , GOS toolbar is getting displayed on screen 0100 also. It should not get displayed on screen 0100.
    What could be the reason??
    Thanks in advance,
    Neha.

    I called the UNPUBLISH method of class CL_GOS_MANAGER in PBO of screen 0100. Problem solved.

  • Attaching URL using GOS with 2 key fields

    I found a program to attach URL using GOS. I tried the program using his sample Business object (BUS2012) and supplied a valid PO and the program works.
    When I use the program using business object BUS1505 (Real Estate Contract) and put a valid contract number, the program didn't attached the URL. When I check the business object, I found out that the key fields are 2, Company Code and Contract Number. With this, how can attach it to the program.
    Please help me on this. Thanks in advance.
    Report  Z_RMTIWARI_ATTACH_DOC_TO_BO
    Written By : Ram Manohar Tiwari
    Function   : We need to maintain links between Business Object and
                 the attachment.Attachment document is basiclally a
                 business object of type 'MESSAGE'.In order to maintain
                 links, first the attachment will be crated as Business
                 Object of type 'MESSAGE' using Message.Create method.
                 Need to check if we can also use FM
                 'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
                 than using Message.Create method.
    REPORT  Z_RMTIWARI_ATTACH_DOC_TO_BO             .
    Include for BO macros
      INCLUDE : <cntn01>.
    Load class.
      CLASS CL_BINARY_RELATION definition load.
      CLASS CL_OBL_OBJECT      definition load.
    PARAMETERS:
    Object_a
       P_BOTYPE LIKE obl_s_pbor-typeid DEFAULT 'BUS1505', " e.g. 'BUS2012'
       P_BO_ID  LIKE OBL_S_PBOR-INSTID DEFAULT '0000010000273',    " Key e.g. PO No.
    Object_b
       P_DOCTY  LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
       P_MSGTYP LIKE SOFM-DOCTP        DEFAULT 'URL'     NO-DISPLAY,
    Relationship
       P_RELTYP  LIKE mdoblrel-reltype DEFAULT 'URL'.
      types: BEGIN OF TY_MESSAGE_KEY,
              FOLTP   TYPE SO_FOL_TP,
              FOLYR   TYPE SO_FOL_YR,
              FOLNO   TYPE SO_FOL_NO,
              DOCTP   TYPE SO_DOC_TP,
              DOCYR   TYPE SO_DOC_YR,
              DOCNO   TYPE SO_DOC_NO,
              FORTP   TYPE SO_FOR_TP,
              FORYR   TYPE SO_FOR_YR,
              FORNO   TYPE SO_FOR_NO,
             END OF TY_MESSAGE_KEY.
      DATA : LV_MESSAGE_KEY type TY_MESSAGE_KEY.
      DATA : LO_MESSAGE type SWC_OBJECT.
      DATA : LT_DOC_CONTENT type standard table of SOLI-LINE with header
    line.
    First derive the Attachment's ( MESSAGE )document type.
      P_DOCTY = 'MESSAGE'.
      CASE P_RELTYP.
      In case of URls
        WHEN 'URL'.
           P_MSGTYP = 'URL'.
      In case of Notes / Private Notes
        WHEN 'NOTE' OR 'PNOT'.
           P_MSGTYP = 'RAW'.
        WHEN 'ATTA'.
           P_MSGTYP = 'EXT'.
      Not implemented as yet...exit
         EXIT.
        WHEN OTHERS.
       ....exit
         EXIT.
        ENDCASE.
    Create an initial instance of BO 'MESSAGE' - to call the
    instance-independent method 'Create'.
      swc_create_object LO_MESSAGE 'MESSAGE' LV_MESSAGE_KEY.
    define container to pass the parameter values to the method call
    in next step.
      swc_container LT_MESSAGE_CONTAINER.
    Populate container with parameters for method
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTTITLE' 'Title'.
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTLANGU' 'E'.
      swc_set_element LT_MESSAGE_CONTAINER 'NO_DIALOG'     'X'.
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTNAME' P_DOCTY.
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTTYPE'   P_MSGTYP.
    'DocumentContent' is a multi-line element ( itab ).
    In case of URLs..it should be concatenated with &KEY& in the begining.
      CASE P_MSGTYP.
        WHEN 'URL'.
          LT_DOC_CONTENT = '&KEY&http://intranet.corpoff' .
          append LT_DOC_CONTENT.
    In case of Notes or Private Notes, get the data from files on appl
    server or from wherever(? - remember background).
         WHEN 'RAW'.
           LT_DOC_CONTENT = 'Hi How r u?' .
           append LT_DOC_CONTENT.
    In case of File attachments
         WHEN 'EXT'.
          Upload the file contents using open dataset in lt_doc_content .
          Some conversion ( Compress ) might be required.
          Not sure at this point
      ENDCASE.
      swc_set_element LT_MESSAGE_CONTAINER 'DocumentContent' LT_DOC_CONTENT.
      swc_call_method LO_MESSAGE 'CREATE' LT_MESSAGE_CONTAINER.
    Refresh to get the reference of create 'MESSAGE' object for attachment
      swc_refresh_object LO_MESSAGE.
    Get Key of new object
      swc_get_object_key LO_MESSAGE LV_MESSAGE_KEY.
    Now we have attachment as a business object instance. We can now
    attach it to our main business object instance.
    Create main BO object_a
      data: LO_IS_OBJECT_A type SIBFLPORB.
      LO_IS_OBJECT_A-INSTID = P_BO_ID.
      LO_IS_OBJECT_A-TYPEID = P_BOTYPE.
      LO_IS_OBJECT_A-CATID  = 'BO'.
    Create attachment BO object_b
      data: LO_IS_OBJECT_B type SIBFLPORB.
      LO_IS_OBJECT_B-INSTID = LV_MESSAGE_KEY.
      LO_IS_OBJECT_B-TYPEID = P_DOCTY.
      LO_IS_OBJECT_B-CATID  = 'BO'.
    *TRY.
    CALL METHOD CL_BINARY_RELATION=>CREATE_LINK
      EXPORTING
        IS_OBJECT_A            = LO_IS_OBJECT_A
       IP_LOGSYS_A            =
        IS_OBJECT_B            = LO_IS_OBJECT_B
       IP_LOGSYS_B            =
        IP_RELTYPE             = P_RELTYP
       IP_PROPNAM             =
       I_PROPERTY             =
    IMPORTING
       EP_LINK_ID             =
       EO_PROPERTY            =
    *CATCH CX_OBL_PARAMETER_ERROR .
    *CATCH CX_OBL_MODEL_ERROR .
    *CATCH CX_OBL_INTERNAL_ERROR .
    *ENDTRY.
    Check if everything OK...who cares!!
      commit work.

    HI
    You can look at object VBAP as an example.  It'sthe sales order item and has two keys - sales order number and item number. 
    the key was created:
    BEGIN OF KEY,
         SALESDOCUMENTNO LIKE VBAP-VBELN,
         ITEMNO LIKE VBAP-POSNR,
    END OF KEY,
         MATERIAL TYPE SWC_OBJECT,
         SALESDOCUMENT TYPE SWC_OBJECT,
         _VBAP LIKE VBAP.
    ND_DATA OBJECT. " Do not change.. DATA is generated
    Here is a object instantiation - just build the key with the two fields - then when you call the macro - you pass the one field that already has both keys in it.
    GET_PROPERTY SALESDOCUMENT CHANGING CONTAINER.
      SWC_CREATE_OBJECT
        OBJECT-SALESDOCUMENT 'VBAK' OBJECT-KEY-SALESDOCUMENTNO.
      SWC_SET_ELEMENT CONTAINER 'SalesDocument' OBJECT-SALESDOCUMENT.
    END_PROPERTY.

  • When attaching documents using GOS send them with workflow

    Hello experts,
    I have a scenario. We have to attach documents to SAP application using GOS. These documents can be edited also.
    Now second part is that when we attach the document or edit the document, the document should be send with the work item "when we attach the document".
    The first part of the scenario is completed and working fine. The second part of the scenario is causing problem. I have checked the various options but none of them are proving helpful.
    There is an option in GOS toolbar to send the documents through workflow but that also asks for the related workflow.
    I was trying to create an event for GOS object which can trigger the workflow automatically when the attachment are created and edited but can not go further with it as not so strong in workflow.
    I request you to kindly help me either in creating this event which will trigger the workflow (whole process) or any other method to do the same.
    Thank you all in advance.

    Hello Andrés,
    Thank you for replying. The main problem is starting the workflow. For that I need to create an event and that is my biggest trouble. I have seen the object IFSAP already. There are no events in it and as such I have created my custom object as super type.
    So I need to create the event from scratch.
    Hope my requirement is clear.
    Thank you.
    Edited by: Apoorv Lohani on Feb 3, 2012 7:54 AM

  • How to attach documents at record level using GOS?

    Hi Guys,
    I have been using GOS for some time now and i am using GOS to attach documents at transaction level.
    Now i need to design a utility where the user would first run a report and this report will bring a few records and the output should have an option to attach some PDF files for each record. Is this possible using GOS? Is there any other simple way to attach documents @ record level and not at transaction level? Any pointers??
    Cheers
    VJ

    two options:
    1. you want to upload document/view document from your report only.
    In this case
    a. go to transaction SBDSV1
    c. class name = "any name you desire without spaces"
       class type = "other objects"
       all other parameters copy from any other objects.
    once this is done, in your program call fm
    call function 'SWU_OBJECT_PUBLISH'
        exporting
          objtype           = 'class name created in stepc'
          objkey            = 'concatenated devlierynumber item number variable'
        exceptions
          objtype_not_found = 1
          others            = 2.
    this will bring up the icon for uploading document in the top left corner of your report. (call it after start of selection)
    to manually test this process , go to transaction OAOR and use class name, type =OT and the key to view or upload the file.
    2. you want to upload/view document from shipment document transaction.
    in this case, you need to find the appropriate BO from SWo1 transaction  which has go delivery number /item number as the key (for example look at BO LIPS from SWO1)
    once this is done you can call the FM mentioned in the previous option by passing the classname and the delivery doc key. the upload/view can alos be done from the standard transaction for that document.
    Hope this is clear.
    Regards
    Raja

  • Changing filename in configuration

    hi there,
    my question is can we change filename of a file in the configuration without using IR(that means no mapping was done)? the scenario is a simple file to file , the only problem is that the filename must be changed.
    is it possible to do this without using a udf(dynamic configuration)?
    thanks.
    ali

    thanks abhishek and srnivas .
    however in my scenario the  sender channel is picking 3 different files that is three files with different names. if i do as you stated, srinivas, all the output files will have the same name, rite?
    e.g
    file1.csv  ---> file1.csv
    file2.csv -
    > file.csv
    file3.csv -
    > file3.csv
    as it can noticed onlyfile2.csv must be changed to file.csv. is it possible to do the above in the configuration itself without using an UDF?
    thanks

  • Send PDF as email attachment using Outlook 2011 ERROR

    Every time I try to send a PDF as an email attachment, I get the following error:
    "An error occurred while trying to create a mail document.  Acrobat is unable to complete your request."
    Prior to getting this error, every time I sent an email Adobe would open the default Mail program on the mac. I  opened mail and changed the preference to use Outlook 2011 as the default mail program, but this did not correct the error.
    Any ideas?
    Thanks!

    AmbooS wrote:
    This is a known issue with Mac Outlook 2011 which is an unsupported version for Acrobat X. This will be supported in the next release.
    If adobe was smart it would be added in the update rather than in than in AcrobatXI  And while at it they need to add support for SeaMonkey and Thunderbird as well.  You've been ingnoring of Dissing Mozilla Products since OSX has been out.

  • Create attachement for GOS in background

    Hi all, i have to create attachments for GOS in the background. i found a blog that suggested me to use the classess 
    CLASS    CL_BINARY_RELATION definition load.
    CLASS    CL_OBL_OBJECT      definition load.
      Link : /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
    Looks like it might work. But problem is iam using 4.6C version and i donot see these classes. Can you please suggest any work around for this.

    Hi Peter, Thanks for the link to the blog. i was able to create attachment for GOS in the background.
    Iam also adding link to this message that found for the same purpose
    http://friendlyabaper.blogspot.com/2008/07/oh-my-gos.html
    Have a nice time.

  • How can I change a style setter using code?

    I have several Labels using the same Style:
    <Canvas.Resources>
    <
    Style TargetType="{x:Type Label}" x:Key="TitleStyle">
    <
    Setter Property="FontSize" Value="24"/>
    <Setter Property="FontWeight" Value="Bold"/>
    </Style>
    </Canvas.Resources>
    I'd like to change the Setter "FontSize" using some code.
    Any idea?

    You cannot change a setter (or anything else in a style) once the style is in use.
    You can create a new style, remove the current style from the resources, and add the new style as the value for key "TitleStyle".  Elements that used DynamicResource to refer to the style will change, but elements that used StaticResource will not.
    Another approach is to add a trigger to your style.  Then you can get the effect of changing FontSize from code:  just have the code change the value that the trigger reads as its input.
    Yet another approach is to data-bind the FontSize to some property that you can change from code, and attach a ValueConverter to the binding that chooses the size you want.

  • OSX.6 change filename color black to white on dark background

    OSX.6 change filename color black to white on dark background

    Thanks for that, but what I asking was how to change the OSX default filename font color from black to white, so it becomes more easily visible when dark backgrounds are selected in icon view, eg the same way the Desktop default does, except when files are not on the Desktop.
    or to put it another way:
    if anyone's worked out an easy way to how to change the color of the font itself, rather than changing the folder/filename background using File, Label, Color, eg because light colors may already be in use as Labels, and so mean something else.
    or as explored in this archived discussion:
    How to change the color of the file name Font in Finder window and Desktop
    https://discussions.apple.com/thread/1744863?threadID=1744863
    Perhaps this is easy for programmers but not for users???

  • Will changing filenames break my library?

    I prefer to have my music files named with the artist and track name. If I rename the files in my library with a script, will it corrupt the library? I've tried a test with one file and the file is renamed and still found by the library. However, the "filename" in itunes still lists the old filename which worries me. Thanks in advance.

    Will changing filenames break my library? The general answer is yes although the Mac can sometimes be more tolerant of such things. If you must rename them use a script which not only renames the files, but also updates iTunes so that it knows where to find them in future. I've written one for Windows, but Doug's AppleScripts is bound to have something for you.
    tt2

  • When i search for mp3 files spotlight shows id3 tags instead of filenames as it used to do !!! I DONT want that .. how can i disable it !!!!!???????

    when i search for mp3 files spotlight shows id3 tags instead of filenames as it used to do !!! I DONT want that .. how can i disable it !!!!!???????

    Sorry, my handful of mp3's had the file name as the id3 tag name.
    So, I am seeing the same thing as you.
    Oddly, a while back I was trying to help someone out in Mountain Lion that wanted to see the id3 tags in the Finder.
    It's all a bit silly. They should have added columns instead or changing it to tag song name.
    They are transitioning to having everything reflect the content and not the file system, so this may not be reversible.
    The best I think you can do is provide feedback: http://www.apple.com/feedback/macosx.html

Maybe you are looking for

  • Select is not working with date range .

    In my program doing a simple select from cdhdr table based on date range i have created but it fails . here is the code I am using. SELECT SINGLE *   FROM tvarv  INTO  wa_tvarv WHERE name EQ 'Z_SERVICE_CHANGE_DATE' . move wa_tvarv-low to v_date . mov

  • JDeveloper ADF Faces Problem: Expression language

    Error(): Expression Language not supported in compile time attribute test I have followed an ADF Faces example from the Oracle Website. Concerning a database + ADF Faces http://www.oracle.com/technology/pub/articles/cioroianu_jsfadf_v4.html I followe

  • Itunes error -42404

    Well, unlike a previous thread about this error code, my itunes will open and play song and music videos. The catch is that it will only play songs and videos that i purchased in the last 4 months or so. All movies and 90% of the songs after that wil

  • Slecting records from MSAccess tables using multiple conditions

    Hi, I am trying to build s select list of team names for a sporting club website. The select list should include teams if the currently logged in user is a coach, team manager, assistant coach, player or a parent of a player. When I have only one gro

  • Question about oc4j-ra.xml

    Hi Under what scenario we need to change the contents of oc4j-ra.xml file for the DBAdapter? Thanks BS