Email SapScript : Question on READ_OTF_FROM_MEMORY

Hi All,
I'm trying to extend my order print program in order to enable the sending by mail of a SapScript.
So :
I'm using :
READ_OTF_FROM_MEMORY
Then
CONVERT_OTF_2_PDF
And
SO_NEW_DOCUMENT_ATT_SEND_API1
( With a little more code ! ).
In debug mode, I can see that the return code of
READ_OTF_FROM_MEMORY
is <b>1</b> :
*-- Read OTF from memory
  CALL FUNCTION 'READ_OTF_FROM_MEMORY'
    EXPORTING
      memory_key   = nast-objky
    TABLES
      otf          = lt_otf
    EXCEPTIONS
      memory_empty = 1
      OTHERS       = 2.
Which means "memory empty" so I can't retrieve my form.
I don't understand why ?
Thx in advance,
Regards,
Erwan

hi Check sample code ::
FUNCTION zisa_container_pack_pdf .
*"*"Local interface:
*"  IMPORTING
*"     VALUE(DELIVERY) LIKE  BAPIVBELN-VBELN
*"  TABLES
*"      IT_PDF STRUCTURE  TBL1024
*"      RETURN STRUCTURE  BAPIRET2
  DATA: lt_pdfdata LIKE TABLE OF tline WITH HEADER LINE.
<b> DATA: lt_otf    TYPE STANDARD TABLE OF itcoo WITH HEADER LINE,</b>
        lt_doctab TYPE STANDARD TABLE OF docs WITH HEADER LINE,
        lt_otfdata TYPE STANDARD TABLE OF itcoo WITH HEADER LINE.
  DATA: x_nast LIKE  nast,  "Message Status
        x_tnapr LIKE tnapr. "Processing programs for output.
  DATA : len TYPE i.
*-- Calling the Subroutine Entry
*-- Get all the details from NAST table
*-- SALESDOCUMENTIN : Sales Document number (Importing parameter)
  SELECT * UP TO 1 ROWS  INTO nast FROM nast WHERE kappl = 'V2' AND
                                       objky = delivery AND
                                       kschl = 'ZDSP' AND
                                       spras = sy-langu.
  ENDSELECT.
  IF sy-subrc = 0.
*-- Get all the details from TNAPR table
*-- 'ZDSP' : Output type defined for the Sales order
*-- '1' : Transmission medium : Printer
    SELECT SINGLE * INTO tnapr
    FROM tnapr WHERE kschl = 'ZDSP' AND
                              nacha = '1' AND
                              kappl = 'V2'.
    IF sy-subrc = 0.
*-- Populate the return code as per the standard driver program
      return_code = 999.
      us_screen = 'X'.
*-- Populate the Transaction code in the NAST structure
*-- 'VL03N' : Sales order Display transaction
      <b>nast-tcode = 'VL03N'.</b>
      PERFORM entry IN PROGRAM zisa_vaddn01_fm USING nast
                                                 tnapr
                                                 return_code
                                                 us_screen.
    ELSE.
      return-type = 'E'.
      return-message = 'No Form found in the TNAPR table'.
      APPEND return.
      CLEAR  return.
    ENDIF.
*-- Read OTF from memory
   <b> CALL FUNCTION 'READ_OTF_FROM_MEMORY'
         EXPORTING
              memory_key   = nast-objky
         TABLES
              otf          = lt_otf
         EXCEPTIONS
              memory_empty = 1
              OTHERS       = 2.</b>
    IF sy-subrc = 0.
*-- Convert the OTF data to PDF data
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
           EXPORTING
                use_otf_mc_cmd         = 'X'
           IMPORTING
                bin_filesize           = v_bin
           TABLES
                otf                    = lt_otf
                doctab_archive         = it_doctab
                lines                  = lt_pdfdata
           EXCEPTIONS
                err_conv_not_possible  = 1
                err_otf_mc_noendmarker = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        return-type = 'E'.
        return-message =
          'An error occured in Converting OTF Data to PDF Data'.
        APPEND return.
        CLEAR  return.
      ELSE.
*       Converting pdf data to raw data
        CALL FUNCTION 'QCE1_CONVERT'
             TABLES
                  t_source_tab         = lt_pdfdata
                  t_target_tab         = it_pdf
             EXCEPTIONS
                  convert_not_possible = 1
                  OTHERS               = 2.
        LOOP AT  it_pdf.
          len = len + STRLEN( it_pdf ).
        ENDLOOP.
*         if ( v_bin = len ).
*         endif.
      ENDIF.
    ELSE.
      return-type = 'E'.
      return-message =
        'An error occured in retrieving OTF Data from Memory'.
      APPEND return.
      CLEAR  return.
    ENDIF.
  ELSE.
    return-type = 'E'.
    return-message = 'No NAST entry found with this Sales Order'.
    APPEND return.
    CLEAR  return.
  ENDIF.
ENDFUNCTION.
Regards
Ashok P

Similar Messages

  • HT5622 Good day to advise you that I forgot security questions, email your questions to re-password security has been compromised by some persons illegitimate since the change

    Good day to advise you that I forgot security questions, email your questions to re-password security has been compromised by some persons illegitimate since the change.
    <E-mail Edited by Host>

    Apple does not respond here.  Do not put email addresses in posts here.  The world will see it.

  • HT1711 i wanted to buy music from itune, but when i log in, it said i should answer my email test question, and i have already forgoting it. please what can i do?

    i wanted to buy music from itune, but when i log in, it said i should answer my email test question, and i have already forgoting it. please what can i do?

    If you've forgotten the answers to your security questions and you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps : https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57

  • HT5312 How can I reset my email security question?

    How can I reset my email security questions?

    Didn't the link to contact the iTunes Store staff in the 'Additional Information' section of that article work for you? If you don't already have a valid rescue email address, only Apple itself can assist with recovering lost answers.
    (89699)

  • TS1424 i forgot provide recure email andsecurity questions and answers. Could you sent it again please?thanks

    i forgot provide recure email ,security questions and answers. Could you sent it again please?thanks
    <Email Edited by Host>

    Not going to happen from here. We are users, not Apple. You need to change your rescue email address in your own Apple ID.
    The Best Alternatives for Security Questions and Rescue Mail
         1.  Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
         2.  Call Apple Support in your country: Customer Service: Contact Apple support.
         3.  Rescue email address and how to reset Apple ID security questions.
    An alternative to using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • IPhoto email shows question mark instead of email template

    I sent some photos using iPhoto last night, i have gmail account i use to send photos. I learned after i had emailed the photos through iPhoto my receipts received the email with a question mark instead of the iPhoto template. I tried sending a couple to myself and my wife (she has hotmail if it matters) but all of them showed the question mark i attached a photo below. Any help in fixing this would be great.
    Thanks

    probably not right format....
    i think that the iphone only supports .jpg or whatever but i am not 100% on that

  • I'm trying to retrieve or change my password for an OLD itunes account. I know longer have access to the email in question and Apple refuses to acknowledge my birthdate. What to do?

    I'm trying to retrieve or change my password for an OLD iTunes account. I no longer have access to the email account in question. Apple will not accept my birthdate. What to do?

    send an e-mail to the iTS customer service using this form, describe your problem and ask the folks there to help you sort it out.
    JGG

  • Chinese characters in outgoing emails become question marks

    Hi, all. My AT&T Blackberry Curve 8900 loaded with the AT&T East-asian rom can read and write Chinese, in IM, email, webpages. There is only one problem with the outgoing emails. I can compose an Email in Chinese and send it. The email is displayed correctly on my phone, but when shown up in the receiving email-box, all chinese characters will become question marks.
    I am using Hotmail - I don't know whether this is some problem with the server.
    Thank you in advance.

    Make sure that you have installed East Asian language support:
    * http://en.wikipedia.org/wiki/Help:Multilingual_support_%28East_Asian%29 Wiki: Help:Multilingual support (East Asian)
    * http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/int_pr_install_languages.mspx?mfr=true - Microsoft Windows XP - Install East Asian language files on your computer

  • Some IPAD noobie email/exchange questions:

    People around here have been super-helpful so if youve answered any of my previous questions, thank you.
    Just started using my first IPAD (3) and have some questions regarding mail:
    1) Is there any faster way to get to an attachment than to scroll down to the end of an email? Why is the "attchment-icon" at the end of the email and not somewhere a bit more accessible?
    2) Everything seemed to have worked fine when I set up exchange but there was no sync for my contacts or notes (only mail and reminders/tasks). What did I possibly do wrong here?
    Finally, for those that use their IPADs for work and who peruse a large amount of emails via exchange, what would you advise I get with regard to a data plan? (I am on Verizon)
    Thanks.

    Hi,
    Make a Hybrid deployment with Exchange on-premises and O365 is a great method : )
    More details, please refer following arcile:
    Exchange Server 2013 Hybrid Deployments
    https://technet.microsoft.com/en-us/library/jj200581%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396
    Thanks
    Mavis Huang
    TechNet Community Support

  • Email configuration question

    Hi-
    I'm having a problem configuring my email accounts for my iPhone. I currently use an Exchange email account through school, linked to Outlook 2007 on my computer (PC). I also have a couple of Gmail and Yahoo accounts that I like to download to my iPhone and computer. My iPhone recently had to be restored and now I'm trying to figure out what I have wrong with my new settings.
    Currently, my emails all download and display properly on my computer. However, emails display twice on my phone, making it appear that they are showing up as being in both the original account and the Exchange account. This could also be an issue with how my Outlook is setup- I'm not sure- but, given the option, I'd prefer not to store outside emails on my Exchange account.
    I apologize for the long-winded question but does anyone have any suggestions?
    Thanks!

    You need to set the outgoing mail settings to your SMTP server and port. Check you outlook settings, the standard SMTP server port is 225.

  • Email alerts question

    when i get an email i only get a star on the envelope icon and not the yahoo mail icon. this is a warranty replacement phone, on my previous phone(same model) showed a star on both the envelope and the yahoo mail icons. i have the blackberry 8530 v5.0.037 (platform 4.2.0.136)

    I just posted this question again because I'm having the same issues only mine is a new phone.  Any luck with figuring it out though?

  • Email spam question

    I get alot of spam and windows mail stops it pretty well.. my question is when i setup my iphone to recieve email all the mail comes spam and all.. anyway around this...

    so i have to get ahold of my isp?.. maybe i will try routing it thru google.. seemed to work on my htc magic

  • EMail Marketing Question

    Hello,
    As a first-time user/admin of email marketing On Demand, I wanted to pose a question for the group.
    It's apparent that you can only load "Contacts" as recipients of email campaigns, but what if you wanted to load "Leads" instead? I realize that Segmentation Wizard is the quick answer, but let me explain further.
    Our organization attends a lot of trade shows, and in advance, we receive lists to which we can send pre-conference emails to a large pool of contacts/leads we've never been in contact with. Given the fact they're unqualified, I consider them a "lead."
    However, there's no single field value to which I'd filter these leads by in Segmentation wizard. Essentially the easiest thing to do was import a list of recipients to a campaign. However, as I mentioned earlier, this isn't possible because they have to be contacts (our organization doesn't consider someone a contact until they're qualified in order to cut down on bad names being converted/added to the system).
    Are there any best practices out there for helping me solve the issue about how to upload large numbers of leads who don't share a common segment (other than they are attending the same conference)?
    Thank You!

    I think Oracle doesn't look at it the same way you do. We're in a similar position. We would add new Leads, then create the Contacts and Accounts when we converted to Opportunites. Contacts did not play a significant role for us. (Our contacts and leads have a 1-to-1 relationship as a practical matter.)
    So, I guess I would ask you how you're adding the new names (as Leads). If you're importing them, just import them as Contacts first. If you give them an External Unique ID, you can easily add associate them when you import them as Leads.
    It's not ideal, but I have found a different solution without using the Contacts.

  • Email icon question

    Just got my new 9930 and really like it so far. 
    I have a question about email though. I have 3 different email accounts on the phone. 1 gmail, 1 roadrunner and 1 yahoo. Only the yahoo email icon has an icon on it that let's me know it's my yahoo account. Is there anyway to get an icon or something on the gmail and RR email icons to let me know what's what?
    thx

    The others who "don't" see that stuff are most likely using Firefox which has a built in PDF viewer that doesn't have those capabilities yet.
    Good news is it IS possible to disable the built in viewer and use Adobe Reader as the default.
    They need to type "about:config" in the address bar in Firefox (minus the quotes).
    In the configuration page, there is a search bar at the top. They need to type "js" in the bar. A short list of settings containing "js" will appear.
    One setting is "pdfjsviewer disabled" and the value is "false". Right click it to Toggle it to True.
    Then under Tools>Options, in the Applications tab, scroll down to find Portable Document Format (PDF) and Click on the drop-down arrow in the Action column for the above entry and select the PDF viewer you wish to use (the attached image shows "Use Adobe Acrobat (in Firefox)", and should be "(use Adobe Reader (in Firefox)" for people without Acrobat Pro installed.

  • Email/Internet Question

    Email: Using the Mail program that came with the Macbook, is there a way to sort your emails into folders? Like in Yahoo it lets you create a new folder for your emails.
    Internet: I keep getting a message asking if I want to stay connected. Then I have to click on Stay Connected to stay connected to the internet.

    Email: Thanks! It worked One more question : It looks like there is a mailbox that wasn't there before. It has a little globe icon thing and a .mac.com address with my user name in front. I don't remember putting it there. Is there a way for it to go away? I know if wasn't there before so I must have done something to have it come up and not realized it.
    Internet: No. I am pretty sure it is a message that comes up on the mac because the text and everything looks the same as some other messages I gave gotten.

Maybe you are looking for

  • Warning message on jump from a BI report

    On jump from a BI report to another (from any characteristic or key figure), following warning message comes up in the second report "Source selection for 0FISCPER incompatible for target selection". This is user specific, not all users are getting t

  • Contract update with reference to an order

    Hello everybody, I'm trying to find a way to update the contract value released (AWERT field in RV45A structure) when an additional order is created with reference to an existing one. Thank you in advance. Mike Edited by: Michael Papadakis on Dec 22,

  • RH9 ShortCut Help Control

    Hello, We are using the evaluation copy of RoboHTML 9 on a Windows 7 64bit machine. We are considering upgrading from x5. We are creating Microsoft HTML Help chm files.  I'm having a problem with ShortCut Button Text. I convert an x5 project that use

  • QT 10.0 opens instead of Adobe

    Since software update from Apple on 9/26,  OuickTimes opens when trying to view a bankstatement online instead of Adobe.  The QT then freezes.  This has never happened before.  Any suggestions?

  • HT5642 Ipad2 updates

    How do I update my ipad2 to ios6.1 thanks db