Application Development and Automation 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: 
Read only

LSMW Conversion Step

Former Member
0 Likes
1,633

Hi Guys,

This forum has been a great help for me so far...so thank you all for helping.

I have created a custom DI LSMW program. The problem is that once I run the conversion step in LSMW it shows the data in the correct target structure but when I go through my program then this structure is empty. THis is what converted data appears in LSMW.

File Z_TEST.lsmw.conv

Structure ZSTRUC

Fld Name Fld Text FldValue

ZPERNR Personnel Number 00000048

My question is that does the target structure get populated after the conversion step or do I need to somehow readt the Z_TEST.lsmw.conv file in my upload program and populate the structure ZSTRUC?

Thanks,

~Mark

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,387

Hi Mark,

The target structure should be populated after the conversion step. If you dotn see it then make sure that you have done the source and target assignment correctly.

Regards,

Guru

8 REPLIES 8
Read only

Former Member
0 Likes
1,388

Hi Mark,

The target structure should be populated after the conversion step. If you dotn see it then make sure that you have done the source and target assignment correctly.

Regards,

Guru

Read only

0 Likes
1,387

Hi Guru,

The soruce and target assignments are fine as you can see in the post above, the values appear properly in the target stuctures in the LSMW "display conversion data" step. It just doesnt show up in this structure when I debug through my program.

~Mark

Read only

0 Likes
1,387

Hi Mark,

You need to read the data from File Z_TEST.lsmw.conv

OPEN DATASET p_phy1 FOR INPUT

IN TEXT MODE

ENCODING DEFAULT.

DO.

READ DATASET p_phy1 INTO l_line.

wa_data = l_line.

APPEND wa_data TO t_data.

You need to get data from *.conv file to internal table t_data, then you can use the data from t_data for assigning.

you need make entry for Physical file path p_phy1 for your Zprogramme in the table /SAPDMC/LSCPROGS.

Regards,

Sivaram.

P.S Mark helpful answers.

Message was edited by:

siva ram

Read only

0 Likes
1,387

Hi Sivaram,

Many thanks for your reply. I need to modify this table in SM30?

Also do you have any sample of what the table entry should look like. Currently my system is not letting me maintain /SAPDMC/LSCPROGS

Thanks,

~Mark

Read only

0 Likes
1,387

Hi Mark,

Yes you need to maintain (modify) the entries in SXDA0, SXDA1, SXDA2, SXDA3 by SM30 T.Code.

and also maintain the below entry.

Go to table /SAPDMC/LSCPROGS

Go to UTILITIES -


> Table Contents -


> Create Entries.

there enter

PROGNAME : ZPROGRAMME

PHYSFILE : P_PHY1

and save.

You need to transport this entry:

click on CONTENTS tab ( CtrlShiftF10 ),

there enter

PROGNAME : ZPROGRAMME

PHYSFILE : P_PHY1

Then F8.

it will show the entry what we made for programme, check that entry and

Table Entry -


> Transport Entries.

After Display Converted data step, it will automatically appears the *.conv file path.

Read only

0 Likes
1,387

Thanks for your helpful response Sivaram.

I am still missing something after doing all these steps.

Where will I get the physical file path? I guess I am missing what will connect the LSMW steps and my Z program in order to get the converted data.

Thanks,

~Mark

Read only

0 Likes
1,387

Hi Mark,

I am sending the Sample code of ZProgramme which attached to LSMW ( in SXDA entries)

*=====================================================================

  • T Y P E S D E C L A R A T I O N

*=====================================================================

TYPES: BEGIN OF tp_data.

include structure YOMS_CON46002_01.

TYPES: END OF tp_data.

*=====================================================================

  • I N T E R N A L T A B L E S D E C L A R A T I O N

*=====================================================================

DATA: t_data TYPE STANDARD TABLE OF tp_data.

*=====================================================================

  • W O R K A R E A S D E C L A R A T I O N

*=====================================================================

DATA: wa_data type tp_data.

*=====================================================================

  • V A R I A B L E S D E C L A R A T I O N

*=====================================================================

DATA : w_osmsg TYPE string,

w_obj_error TYPE REF TO cx_root,

w_message(50) TYPE C.

*=====================================================================

  • I N C L U D E S

*=====================================================================

include bdcrecx1.

*=====================================================================

  • C O N S T A N T S D E C L A R A T I O N

*=====================================================================

CONSTANTS :c_e TYPE c VALUE 'E',

c_s TYPE c VALUE 'S',

c_one(02) TYPE c VALUE '01',

c_1 TYPE c VALUE '1',

c_2 TYPE c VALUE '2',

c_x TYPE c VALUE 'X'.

*======================================================================

  • SELECTION SCREEN

*======================================================================

SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

PARAMETERS: p_phy1 TYPE rlgrap-filename

OBLIGATORY LOWER CASE.

SELECTION-SCREEN END OF BLOCK blk1.

*======================================================================

  • START-OF-SELECTION

*======================================================================

START-OF-SELECTION.

PERFORM init_tables.

PERFORM get_data.

PERFORM open_group.

*=====================================================================

  • END-OF-SELECTION

*=====================================================================

END-OF-SELECTION.

*C--Call the routine to process the data.

PERFORM process_data.

*C--Call the routine to Display all the messages

PERFORM close_group.

PERFORM display_messages.

*C-- Routine to initialize int tables and work areas.

PERFORM free_tables.

&----


*& Form get_data

&----


  • Routine to transfer data to t_data from converted data file

----


FORM get_data .

DATA : l_line TYPE di_data,

l_frlength TYPE i,

l_wllength TYPE i,

l_lines TYPE i,

l_stype TYPE stype_bi.

CLEAR: l_wllength,

l_line,

l_lines,

l_stype,

w_osmsg,

w_obj_error.

DESCRIBE FIELD l_line LENGTH l_wllength IN CHARACTER MODE.

*C--Open the file

TRY.

OPEN DATASET p_phy1

FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE w_osmsg.

CATCH cx_sy_file_authority INTO w_obj_error.

PERFORM catch_error USING w_obj_error.

ENDTRY.

IF sy-subrc NE 0.

MESSAGE w_osmsg TYPE c_s DISPLAY LIKE c_e.

LEAVE LIST-PROCESSING.

ENDIF.

DO.

READ DATASET p_phy1 INTO l_line.

IF sy-subrc EQ 0.

l_lines = l_lines + 1.

IF l_frlength GT l_wllength.

MESSAGE s446(mg) DISPLAY LIKE c_e WITH l_frlength

l_wllength.

LEAVE LIST-PROCESSING.

ENDIF.

l_stype = l_line+0(1).

CASE l_stype.

WHEN '0'.

CONTINUE.

WHEN c_1.

wa_data = l_line.

APPEND wa_data TO t_data.

CLEAR wa_data.

WHEN OTHERS.

MESSAGE i241 WITH space l_lines l_stype.

ENDCASE. " l_stype

ELSE.

*C-- End of File

EXIT.

ENDIF. " sy-subrc EQ 0

ENDDO.

CLOSE DATASET p_phy1.

&----


*& Form init_tables

&----


  • Initialize all the internal tables, work areas.

----


FORM init_tables .

REFRESH: t_data.

CLEAR : wa_data.

ENDFORM. " init_tables

&----


*& Form process_data

&----


  • Routine to process the data

----


FORM process_data .

CLEAR : wa_data.

LOOP AT t_data INTO wa_data.

perform bdc_dynpro using 'SAPMV13B' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RV13B-KSCHL'.

perform bdc_field using 'BDC_OKCODE'

'=ANTA'.

perform bdc_field using 'RV13B-KSCHL'

wa_data-kschl.

perform bdc_dynpro using 'SAPLV14A' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RV130-SELKZ(01)'.

perform bdc_field using 'BDC_OKCODE'

'=WEIT'.

perform bdc_dynpro using 'SAPMV13B' '1933'.

perform bdc_field using 'BDC_CURSOR'

'NACH-VSZTP(01)'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'KOMB-LFART'

wa_data-lfart.

perform bdc_field using 'KOMB-VSTEL'

wa_data-vstel.

perform bdc_field using 'KOMB-KUNWE(01)'

wa_data-kunwe.

perform bdc_field using 'NACH-PARVW(01)'

wa_data-parvw.

perform bdc_field using 'NACH-NACHA(01)'

wa_data-nacha.

perform bdc_field using 'NACH-VSZTP(01)'

wa_data-vsztp.

perform bdc_dynpro using 'SAPMV13B' '1933'.

perform bdc_field using 'BDC_CURSOR'

'KOMB-KUNWE(01)'.

perform bdc_field using 'BDC_OKCODE'

'=KOMM'.

perform bdc_field using 'RV130-SELKZ(01)'

'X'.

CASE wa_data-nacha.

*----


For Medium '1'

when '1'.

perform bdc_dynpro using 'SAPMV13B' '0211'.

perform bdc_field using 'BDC_CURSOR'

'WFMC_STRUC-TDFORM'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_field using 'NACH-LDEST'

wa_data-ldest.

perform bdc_field using 'NACH-DIMME'

wa_data-dimme.

perform bdc_field using 'NACH-ANZAL'

wa_data-anzal.

perform bdc_field using 'NACH-DELET'

wa_data-delet.

perform bdc_field using 'WFMC_STRUC-TDFORM'

wa_data-PFLD4.

perform message.

perform bdc_transaction using 'VV21'.

*----


For Medium '2'

when '2'.

perform bdc_dynpro using 'SAPMV13B' '0233'.

perform bdc_field using 'BDC_CURSOR'

'NACH-DELET'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_field using 'NACH-OBJTYPE'

''.

perform bdc_field using 'NACH-TDSCHEDULE'

wa_data-tdschedule.

perform bdc_field using 'WFMC_STRUC-FAXTITLE'

wa_data-TDCOVTITLE.

perform bdc_field using 'NACH-DIMME'

wa_data-dimme.

perform bdc_field using 'NACH-DELET'

wa_data-delet.

perform message.

perform bdc_transaction using 'VV21'.

*----


For Medium '5'

when '5'.

perform bdc_dynpro using 'SAPMV13B' '0235'.

perform bdc_field using 'BDC_CURSOR'

'NACH-TCODE'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_field using 'NACH-TCODE'

wa_data-tcode.

perform message.

perform bdc_transaction using 'VV21'.

ENDCASE.

ENDLOOP.

ENDFORM. " process_data

&----


*& Form catch_error

&----


  • Catch the error messages of the application server

----


FORM catch_error USING FP_OBJ_ERROR TYPE REF TO cx_root.

DATA : l_message TYPE string.

CLEAR :l_message.

l_message = fp_obj_error->if_message~get_text( ).

MESSAGE l_message TYPE c_s DISPLAY LIKE c_e.

LEAVE LIST-PROCESSING.

ENDFORM. " catch_error

&----


*& Form display_messages

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_messages .

ENDFORM. " display_messages

&----


*& Form message

&----


FORM message .

clear w_message.

IF ctu = c_x.

CONCATENATE 'For this Ship-To Party :'(001) wa_data-KUNWE INTO

w_message

SEPARATED BY space.

WRITE 😕 w_message.

ENDIF.

ENDFORM. " message

&----


*& Form free_tables

&----


FORM free_tables .

FREE: t_data.

CLEAR : wa_data.

ENDFORM. " free_tables

Read only

Former Member
0 Likes
1,387

hi mark,

U can go to the logical file and see the physical file that is attached to ur logical file.. u can go to the transaction file and check details of logical file or even in ur lsmw but always be careful while handling logical file..

regards ,

Rajkumar.