Skip to Content
0
Former Member
Jul 30, 2012 at 08:46 AM

DOI with Word

93 Views

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!