cancel
Showing results for 
Search instead for 
Did you mean: 

How to enhance field LIFNR into datasource 0CO_OM_NTW_1 and 0CO_OM_NWA_1

Former Member
0 Kudos

Is it possible to enhance vendor field (LIFNR) into datasource Network plan: Costs 0CO_OM_NTW_1 and Network Activity: Costs 0CO_OM_NWA_1 in R/3 side? If yes, which is the possible way to enhance it so that I can get vendor data in PS_C07 for available in reporting. I will remark points for your answer. Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I created append structure and add one new field ZZLINFR. Choose AUFNR and FISCPER as well as KOKRS as key mapping fields. The code like below. Really thanks your great help.

Data: l_s_iccstntw LIKE iccstntw.

CASE i_datasource.

WHEN ' 0CO_OM_NTW_1.

Loop AT c_t_data INTO l_s_iccstntw.

l_tabix = sy-tabix.

SELECT SINGLE linfr FROM mseg INTO l_s_iccstntw-zzlinfr

WHERE aufnr = l_s_iccstntw-aufnr

AND gjahr = l_s_iccstntw-fiscper+0(4)

AND kokrs = l_s_iccstntw-kokrs.

MODIFY c_t_data FROM l_s_iccstntw INDEX l_tabix.

ENDLOOP.

WHEN OTHERS.

EXIT.

ENDCASE.

former_member181964
Active Contributor
0 Kudos

Hi

Here see the sample code which for Vendor for different DS, so chnage the below code as per your requirement.

DATA: i_s_data_wbs6 LIKE icwbscsta1. 

WHEN '0CO_OM_WBS_6'.

    LOOP AT c_t_data INTO i_s_data_wbs6.
      l_tabix = sy-tabix.
      	  SELECT SINGLE lifnr ebeln INTO (i_s_data_wbs6-lifnr,i_s_data_wbs6-zzebeln) FROM
                  mseg WHERE
               mblnr      = i_s_data_wbs6-refbn.

      IF sy-subrc = 0.
        MODIFY c_t_data FROM i_s_data_wbs6 INDEX l_tabix.
      ENDIF.
    ENDLOOP.

Answers (6)

Answers (6)

Former Member
0 Kudos

In my case I can use bseg or mseg, so which one is best one, and why? If the mapping field is not the index of the table, I think it will cause some performance issue during data loading. Any suggestion? It seems that datasource 0FI_GL_4 which contain AUFNR, LIFNR, BUKRS..., is it possible to use 0FI_GL_4 as one of the datasources for PS_C07 in order to add vendor information(LIFNR) into PS_C07? Thanks for your suggestion.

Former Member
0 Kudos

Thanks, I modified again like below:

Data: l_s_iccstntw LIKE iccstntw,

l_s_iccstnwa LIKE iccstnwa.

WHEN '0CO_OM_NTW_1'.

Loop AT c_t_data INTO l_s_iccstntw.

l_tabix = sy-tabix.

SELECT SINGLE linfr FROM mseg INTO l_s_iccstntw-zzlinfr

WHERE aufnr = l_s_iccstntw-aufnr

AND gjahr = l_s_iccstntw-fiscper+0(4)

AND kokrs = l_s_iccstntw-kokrs.

IF sy-subrc = 0.

MODIFY c_t_data FROM l_s_iccstntw INDEX l_tabix.

ENDIF.

ENDLOOP.

WHEN '0CO_OM_NWA_1'.

Loop AT c_t_data INTO l_s_iccstnwa.

l_tabix = sy-tabix.

SELECT SINGLE linfr FROM mseg INTO l_s_iccstnwa-zzlinfr

WHERE aufnr = l_s_iccstnwa-aufnr

AND gjahr = l_s_iccstnwa-fiscper+0(4)

AND kokrs = l_s_iccstnwa-kokrs.

IF sy-subrc = 0.

MODIFY c_t_data FROM l_s_iccstnwa INDEX l_tabix.

ENDIF.

ENDLOOP.

WHEN OTHERS.

EXIT.

ENDCASE.

former_member181964
Active Contributor
0 Kudos

Hi,

Wht is the problem in your code. It will run , so try to check it in RSA3.

Thanks

Reddy

Former Member
0 Kudos

For example, I paste all components information of structure ICCSTNWA below, I try to find a table which has some fields that can be matched with components of structure ICCSTNWA, however I can not find the right table. It seems LFB1 and LFA1 both are not correct one. Does someone have the same issue? Thanks for your input.

Structure:ICCSTNWA

FISCVAR

FISCPER

KOKRS

PSPID

POSID

AUFNR

VORNR

VTYPE

VTDETAIL

VTSTAT

VERSN

KSTAR

SEKNZ

RSPOBART

RSPAROBVAL

VALUTYP

MEASTYPE

SWKPP

SWKDP

SWG

SMEG

WAERS

CURTYPE

MEINH

GUID

CPR_GUID

Former Member
0 Kudos

Thanks. But, which table should I select during enhancement? And this table should include vendor information.

former_member181964
Active Contributor
0 Kudos

Hi,

You have vendor information in LFA1 and LFB1. or else ask you rfunctional team from which table I need to pick the Vendor code. accordingly you do it.

Thanks

Reddy

former_member181964
Active Contributor
0 Kudos

Hi,

I think the best tables for your requirement is MSEG or BSEG.

Decause 0CO_OM_NTW_1 is having primary key AUFNR -Order Number, so based on that you pick LIFNR.

Thanks

Reddy

Former Member
0 Kudos

Does someone has an idea, how to write ABAP code to enhance LIFNR into datasource in this case? Please give a simple example. Thanks!!!

Former Member
Former Member
0 Kudos

Both of these datasources are based on extract structures ICCSTNTW and ICCSTNWA .Enhance these two extract structures with append structure and add field LIFNR and write code in user exit "EXIT_SAPLRSAP_001" to populate the same

Regenerate datasource and unhide the lifnr field in RSA6.Test in RSA3

Edited by: Phanindra Kumar Chittavajhula on Feb 11, 2009 4:06 AM