You will find that the SAP standard fields provided for letters in the Recruitment module are not sufficient and you will have a requirement for additional fields to be brought into the letters.
This document provides a step by step guide to enable you to do this on your own – whether you are using SAP Script or MS Word as your output medium.
The screen shots used in this article are taken from version 4.6c which for this piece of functionality is very similar to other versions of SAP.
Customer Structure
The first thing you need to do is to create a customer structure for your new fields. In this example it is called Zrecruit. You can create the structure using transaction code SE11. Remember to start the name with a Z.
If you have a lot of additional fields to create, it may be worth creating multiple structures. The advantage of doing this is that fields from the same structure are grouped in a similar area – this makes it easier to select a field from the drop-down list. Remember that the fields are sorted alphabetically first by structure and then by field name within the structure.
The database fields that you want to use as text variables must generally be of the type CHAR or NUMC.
Remember to declare all of the structures via tables in ZPAP3CUS and that they are all available for MS Word with the form FILL_CUSTOMER_STRUCTURE
Tip: Don’t include an underscore in either the name of the field or structure.
Customer Programme
SAP provides a programme which can be copied and renamed using transaction code SE38. Copy the program MPAP3CUS to ZPAP3CUS.
Tip: You need to give your new programme the name ZPAP3CUS – otherwise your new structure won’t be called.
Declare the relevant tables that you are going to be using.
Insert your structure name into the relevant place in the line of code “PERFORM add_customer_structure(rpaprt05) USING ‘xxxxxxx’
Where xxxxxx is the name of your bespoke structure.
You then need to insert the relevant code into the programme within the “FORM fill_customer_data” area. The programme will execute the form you have stipulated.
Sample code to transfer the first line of the address line on infotype 0006 (field stras) can be seen in the screen shots below.
Remember to check, save and activate the programme – just activate if you are a confident user.
Go and edit your letter. You should see the additional field in the drop down list of mail merge fields in MS Word. In addition it should be available to be brought into SAP Script.
Tips
- To enable a field to be used in SAP Script you don’t need to fill in the form FILL_CUSTOMER_STRUCTURE.
- Remember to enable macros in MS Word in order for the letters to pull through the data for the fields.
- If you are wanting to email your letters, you will need to use SAP Script.
No comments:
Post a Comment