Skip to Content
author's profile photo Former Member
Former Member

DOI with Word

Hi All,


this is my first question in this SAP Community, I hope for a lot of responses 😊


I am faced with following Problem:

Already implemented:

I have Word forms with individual layouts used as a template for letters.

In SAP I have an own report, where I can choose the content for the letter. For e.g: Company, Bank, Account Informations.

The template layout can contain single textfields or textfields in a tablestructure.

The contenttext of the textfields is specified. E.g.: &VB.BUTXT& - here I know that I have to write the company description in

this field.

Furthermore it is possible to have conditions and indices.

E.g: &VPB[1].NAME_FIRST{STATUS_P2BUK= 3}& - (PB is an index for a Table in SAP with all contact persons of the chosen company)

- so here I have to fill the field with the first name of the first contact person where the contact person has a special

status.


so, this is working fine with DOI. I am getting the data of the Word form imported in SAP in form of a table like this:

TYPES: BEGIN OF SOI_FORM_ITEM,

TYPE TYPE C,

NAME(128) TYPE C,

NUMBER(3) TYPE C,

VALUE(256) TYPE C,

CODE TYPE C,

END OF SOI_FORM_ITEM.
The value contains the conditions and i overwrite it with the correct content.


Now, here is my problem:
It should be possible to define fields in the word template like this:
&VPB[X].NAME_FIRST{STATUS_P2BUK= 3}& - the first name of every contact person with a special status = 3 should be inserted.
My problem is that if this field is defined in a table structure a new line should be added in the table for each person.
If it is defined in a special layout of multiple fields, this whole layout of fields has to be created new.

The person who designs the Word template don't know how many entires it would be.
I am free to define how the layout of the template should be created. It would be great if I can keep the current logic of the

ABAP part. But I am happy as well if there is an other solution.

The only decision is that I have to use DOI. Because SmartForms is too old? And for Adobeair you need a license?


Thanks for every response!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 30, 2012 at 12:37 PM

    Hi.

    The only solution I can see is that you have in your word template the table with as many &VPB[X] fields& as you need ... After you can feed or not these fields...

    The other solution is to generete a VB script behind your template that can delete all the rows you don't need, or you can generate a list of all your person and use this list to feed the word template...

    If you send your word template, probably I can understand better your need.

    Hope to help, bye.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Roberto Vacca

      Hi,

      yes, we discussed to use macro VBs in some way.

      But the only colleague who knows VB is on holiday at the moment.

      I have now tried to use OLE Methods/ properties to get forward. Isn't a OLE method an existing Word VB function? I havn't found a list of possible methods/ properties.

      At the moment I can insert a table into the document, but still only at the beginning. So i am still facing the same problem to somehow define the position.

      Thx for your help

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.