Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom segment for HRMD_A07

Former Member
0 Kudos

hello Experts,

I need to send Inoftype 0290 details on HRMD_A idoc,  the structure for IT0290 does nto exist in HRMD_A07. Hence i have created a custom IDOC segment, Z1P0290 and attached this segment to IDOC Extension - ZHR_EXT.

So far I have :

  1. We30 - create segment Z1P0290.
  2. Assign Z1P0290 to extension ZHR_EXT
  3. Change technical attribtes for iT 0290 in PM01 and assigned Z1P0290  as IDOC segment
  4. Added custom code in FUNCTION EXIT_SAPLRHAL_003 to send data to Z1P0290.
  5. Everything works fine, but when IDOC is created Z1P0290 structure is not picked up. Instead all data is displayed in one line in field "OBJPS" - see attached image.

What am I missing?

Vaishali

6 REPLIES 6

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

Can you try this way.

In 'EXIT_SAPLRHA0_004' denire 1 include like this.

INCLUDE ZXHALU08 .

Inside the above Include ,populate the
IDOC control segment

F_idoc_control-cimtyp = 'ZRMD_A07'.

Here ZRMD_A07 is the custom segment for 290 data.

90% cases the above will resolve your issue.

You are doing the Execution with PFAL I believe.

Regards,

Sreeram

0 Kudos

Sreeram,

Thanks for your answer. Z1P0290 is not an extension, it is a segment which belongs to extension ZHR_EXT and as you rightly said, i have already updated User Exit 'EXIT_SAPLRHA0_004'  with

IF f_idoc_control-mestyp = 'HRMD_A'.

   f_idoc_control-cimtyp = 'ZHR_EXT'.

ENDIF.

There is something else that i am missing and cant find!

Vaishali

0 Kudos

problem resolved - updating thread for benefit of other browsers.

Exit_SAPLRHAL_003 was not correctly updating the structure values. Following code added to populate Z1P0290 correctly.

*&---------------------------------------------------------------------*

*&  Include           ZXHALU04

*&---------------------------------------------------------------------*

DATA : ls_0290 LIKE p0290,

        i1p0290 LIKE z1p0290.

IF pnnnn_name = 'P0290' .

   FIELD-SYMBOLS: <fs_plog> TYPE any.   "Field Symbol for dynamic filling of data based on the structure

*Clearing the SUBRC

   CLEAR subrc.

* fill workarea for infotype with infotype-data

   ASSIGN pnnnn_data TO <fs_plog> CASTING TYPE p0290.

   ls_0290 = <fs_plog>.

   ASSIGN sdata_data TO <fs_plog> CASTING TYPE z1p0290.

   i1p0290 = <fs_plog>.

* move fields

   MOVE-CORRESPONDING ls_0290 TO i1p0290.

** fill IDoc-data with workarea for segmenttype

   <fs_plog> = i1p0290.

   converted = 'X'.

ENDIF.

0 Kudos

Hello Vaishali - Though it is old post, your above post is very helpful , as I am having exact issue with infotype 0554. 

I created custom segment (and released segment) and attached to extn (and released extn)  and added code in both user exits as above and maintained correct WE20 profiles having extn .

However, when I change some thing in 554 , it is treating it as change . So BDCPV / BDCP2 entry is not there. So obviously when I run BD21, it is not picked up. Even when create IDoc through PFAL the new segment for 0554 is not coming.  After adding IDoc segment in technical attributes in PM01 (ot T777D) , do we need to regenerate  ?  Wondering, why the changes I made to 0554 are not being considered. or do you see I  am missing any obvious step ?  Any help or suggestion , in this regard is helpful.  Thanks in advance.

0 Kudos

Vaishali / All - I was able to find my mistake. As per note 105148  , it clearly mentioned, segment name must be of Z1PXXXXX.  (In my case, I gave it as ZE1PXXXXX). Once I corrected that, it is working correctly. Thanks for initial post though.

For each additional infotype, create a new segment type Z1Pnnnn (with nnnn = infotype number). Note the

following: The naming of the s

egment type must be in accordance with the naming convention Z1Pnnnn or Y1Pnnnn. Otherwise, the system

cannot distribute any data for

the infotype.

To simplify processing, you can use the "Create with template" function. In this case, you do not write any change

pointers.

0 Kudos

Yes Sampath, thats right.

The segment names must be Z1PXXXXX. I too faced this issue. Thanks for posting the SAP note.

This is useful for others who face similar issues.

Good Luck,

Vaishali