Site icon SAP Human Resources Experts And Solutions

How to send custom infotype over SAP ALE

<p>There is a number of infotypes in SAP which are local to some country&period; SAP doesn&&num;8217&semi;t provide any standard solution to send these country-specific or custom infotypes over ALE&comma; cause standard IDOC contains only international infotypes&period; If you develop your infotype and want to send it over <a href&equals;"https&colon;&sol;&sol;saphcmsolutions&period;com&sol;how-sap-ale-works&sol;" target&equals;"&lowbar;blank" rel&equals;"noopener">ALE<&sol;a> there are some tips and tricks to handle&period; Today I want to tell you how to send custom infotype or country-specific infotype over SAP ALE&period; It&&num;8217&semi;s going to be a long tutorial with a lot of images&period; More than I&&num;8217&semi;d like to show you what is a short and long infotype record in terms of SAP integration and IDOC structure&period; And&comma; of course&comma; ABAP source codes will be provided for your convenience&period; Take a cup of coffee and join me with this unique tutorial never been shared before&period;<&sol;p>&NewLine;<h3>Sending short infotypes over SAP ALE<&sol;h3>&NewLine;<p>A short infotype is an infotype&comma; the size of which fits into one IDOC segment&period; How to check&quest; Open SE11 transaction&comma; find an infotype structure which is PXXXX &lpar;XXXX &&num;8211&semi; infotype code&rpar;&comma; sum all length fields&period; One IDOC segment can store 1000 symbols&period; If the infotype structure is longer than 1000 symbols it&&num;8217&semi;s a long infotype and we will need to split it to send over SAP ALE&period; Will show later how it works&period;<&sol;p>&NewLine;<p>To add custom infotype to a standard HRMD&lowbar;A IDOC in <strong>WE31<&sol;strong> transaction create a new segment to include it into IDOC and send over ALE&period; Naming rule is <strong>Z1PXXXX<&sol;strong>&comma; 7 symbols&period; It&&num;8217&semi;s done for prior 4&period;6C compatibility&comma; so if you work with modern systems you can use longer names&period; The first three letters &&num;8216&semi;Z1P&&num;8217&semi; is a must&period; To save time and avoid human mistakes typing all SE11 fields into segment manually you can create a segment from a template&period; In menu Segment -&gt&semi; Create with template choose DDIC structure and type in PXXXX&comma; where XXXX is your infotype code&period; When you save segment systems checks its length to comply with <strong>1000 IDOC segment length<&sol;strong>&period;<&sol;p>&NewLine;<p>In my scenario&comma; I&&num;8217&semi;ll use country-specific infotype 0293&period; Here is how it looks like in segment&period;<&sol;p>&NewLine;<div id&equals;"attachment&lowbar;3190" style&equals;"width&colon; 641px" class&equals;"wp-caption alignnone"><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;01&period;png"><img aria-describedby&equals;"caption-attachment-3190" class&equals;"wp-image-3190 size-full" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;01&period;png" alt&equals;"New IDOC segment" width&equals;"631" height&equals;"743" &sol;><&sol;a><p id&equals;"caption-attachment-3190" class&equals;"wp-caption-text">New IDOC segment<&sol;p><&sol;div>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<p>Don&&num;8217&semi;t forget to release the segment in Edit menu&period;<&sol;p>&NewLine;<p><&excl;--more--><&sol;p>&NewLine;<p>For this tutorial&comma; I&&num;8217&semi;ve set ALE integration within one SAP instance&period; It means sender and receiver both in the same system on the same server&period; So all settings are distributed across both sender and receiver clients&period; If you send data outside of one server you need to perform some settings on receiving system&period;<&sol;p>&NewLine;<p>I both systems we need to specify IDOC segment in <strong>T777D<&sol;strong> view like in a picture below&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;02&period;png"><img class&equals;"alignnone size-full wp-image-3191" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;02&period;png" alt&equals;"" width&equals;"561" height&equals;"357" &sol;><&sol;a><&sol;p>&NewLine;<p>In both systems in <strong>WE30<&sol;strong> create IDOC extension for basic type HRMD&lowbar;A&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;03&period;png"><img class&equals;"alignnone size-full wp-image-3192" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;03&period;png" alt&equals;"" width&equals;"577" height&equals;"277" &sol;><&sol;a><&sol;p>&NewLine;<p>Add our new segment to IDOC structure&period; Adding this will say ALE infrastructure to send not basic HRMD&lowbar;A IDOC but use your custom infotype segment on top of standard IDOC&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;04&period;png"><img class&equals;"alignnone size-full wp-image-3193" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;04&period;png" alt&equals;"" width&equals;"787" height&equals;"278" &sol;><&sol;a><&sol;p>&NewLine;<p>Half the job done&period; Release this extension in Edit menu&period;<&sol;p>&NewLine;<p>In <strong>WE82<&sol;strong> add our extension to message type HRMD&lowbar;A so the system will use it instead of standard IDOC&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;05&period;png"><img class&equals;"alignnone size-full wp-image-3194" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;05&period;png" alt&equals;"" width&equals;"571" height&equals;"492" &sol;><&sol;a><&sol;p>&NewLine;<p>Change partner profile to send an extended version of HRMD&lowbar;A IDOC&period; It could be done in <strong>WE20<&sol;strong> or BD64 transaction&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;06&period;png"><img class&equals;"alignnone size-full wp-image-3195" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;06&period;png" alt&equals;"" width&equals;"646" height&equals;"632" &sol;><&sol;a><&sol;p>&NewLine;<p>Let&&num;8217&semi;s test&period; Open <strong>PFAL<&sol;strong> and send your personnel number&period; We can see our segment filled out with data correctly&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;07&period;png"><img class&equals;"alignnone size-full wp-image-3196" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;293&lowbar;07&period;png" alt&equals;"" width&equals;"1024" height&equals;"741" &sol;><&sol;a><&sol;p>&NewLine;<p>You&&num;8217&semi;re done and can send almost any hr infotype in ALE distribution model&period; Almost any because a lot of infotypes and specifically custom infotypes are not that long to use long infotype ALE distribution solution&period;<&sol;p>&NewLine;<h3>Sending long infotype over ALE<&sol;h3>&NewLine;<p>It&&num;8217&semi;s a little more complicated&period; Overall we can send custom infotype over ALE with the length no more than 3000 symbols&period; We remember one segment is 1000 long&comma; so we need to split our infotype into three chunks&period; The solution is simple&period; We need to have something unique in each segment to be able to build infotype back after we&&num;8217&semi;ve split it&period; Best practice is to include a well-known <strong>PSKEY<&sol;strong> structure as a key field into each segment&period; It would allow us to split infotype without any data loss and build it again in receiving system&period; Very easy&excl; Like a blockchain in SAP HR &colon;&rpar; Once receiving system gets this IDOC it reads all segments with the same key and recovers the whole picture&period;<&sol;p>&NewLine;<p>For this example&comma; I&&num;8217&semi;ll take a long infotype which is almost 1600 symbols long&period; We&&num;8217&semi;ll use two segments&period; The first segment is Z1PA0294 and second is Z1PB0294&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;01&period;png"><img class&equals;"alignnone size-full wp-image-3198" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;01&period;png" alt&equals;"" width&equals;"682" height&equals;"744" &sol;><&sol;a><&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;02&period;png"><img class&equals;"alignnone size-full wp-image-3199" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;02&period;png" alt&equals;"" width&equals;"628" height&equals;"745" &sol;><&sol;a><&sol;p>&NewLine;<p>To connect two segments we make them dependable on each other&period; The first segment is a parent&comma; second is a child&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;03&period;png"><img class&equals;"alignnone size-full wp-image-3200" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;03&period;png" alt&equals;"" width&equals;"713" height&equals;"200" &sol;><&sol;a><&sol;p>&NewLine;<p>Don&&num;8217&semi;t forget to say system we have a couple of segments in our infotype&period; In <strong>T777D<&sol;strong> fill second segment field with our data&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;04&period;png"><img class&equals;"alignnone size-full wp-image-3202" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;04&period;png" alt&equals;"" width&equals;"638" height&equals;"351" &sol;><&sol;a><&sol;p>&NewLine;<p>Run <strong>PFAL<&sol;strong> and here is what we see&period; Child segment is empty&period; What&&num;8217&semi;s wrong&quest;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;05&period;png"><img class&equals;"alignnone size-full wp-image-3203" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;05&period;png" alt&equals;"" width&equals;"1007" height&equals;"476" &sol;><&sol;a><&sol;p>&NewLine;<p>Here is a trick&period; SAP doesn&&num;8217&semi;t know how we want to fill our segments&period; In case one segment it&&num;8217&semi;s very simple &&num;8211&semi; the system just copies data with <strong>move-corresponding ABAP statement<&sol;strong>&period; We need to help SAP to fill this data&period; Create a project in <strong>CMOD<&sol;strong> with this <strong>RHALE001<&sol;strong> enhancement&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;06&period;png"><img class&equals;"alignnone size-full wp-image-3204" src&equals;"https&colon;&sol;&sol;saphr&period;ru&sol;wp-content&sol;uploads&sol;ale&lowbar;294&lowbar;06&period;png" alt&equals;"" width&equals;"600" height&equals;"209" &sol;><&sol;a><&sol;p>&NewLine;<p>Inside activate two components&period; One to split infotype into chunks and second to glue chunks into one whole piece&period;<&sol;p>&NewLine;<p>EXIT&lowbar;SAPLRHAL&lowbar;003 &&num;8211&semi; split<br &sol;>&NewLine;EXIT&lowbar;SAPLRHAL&lowbar;004 &&num;8211&semi; glue<&sol;p>&NewLine;<p>I&&num;8217&semi;ve written two functional modules to do data conversion&period; Sources provided at the end of this article&period;<&sol;p>&NewLine;<p>ZCONVERT&lowbar;P0294&lowbar;TO&lowbar;Z1PA0294<br &sol;>&NewLine;ZCONVERT&lowbar;Z1PA0294&lowbar;TO&lowbar;P0294<&sol;p>&NewLine;<p>By the name you can guess that one converts the infotype into a segment&comma; the second is the reverse&period; Pay attention both FMs refers to the first&comma; parent segment&comma; not both&period;<&sol;p>&NewLine;<p>Activate functional modules&comma; activate CMOD project and run PFAL&period; You&&num;8217&semi;ll see the child segment filled with data&period;<&sol;p>&NewLine;<p>In case you need to do some data conversion you can do it inside these functional modules or use standard solution which I described in another post&colon; <a href&equals;"https&colon;&sol;&sol;saphcmsolutions&period;com&sol;data-conversion-sap-ale&sol;" target&equals;"&lowbar;blank" rel&equals;"noopener">Data conversion in SAP ALE<&sol;a><&sol;p>&NewLine;<p><strong style&equals;"color&colon; &num;ff9900&semi;">Share this post with your SAP friends and colleagues&period; It won&&num;8217&semi;t cost you anything but will motivate us to write more interesting content&period;<&sol;strong><br &sol;>&NewLine;<&excl;-- Begin MailChimp Signup Form --><&sol;p>&NewLine;<style type&equals;"text&sol;css">&NewLine;&Tab;&num;mc&lowbar;embed&lowbar;signup&lbrace;background&colon;&num;fff&semi; clear&colon;left&semi; font&colon;14px Helvetica&comma;Arial&comma;sans-serif&semi; width&colon;100&percnt;&semi;&rcub;<br &sol;>&NewLine;&Tab;&sol;&ast; Add your own MailChimp form style overrides in your site stylesheet or in this style block&period;<br &sol;>&NewLine;&Tab; We recommend moving this block and the preceding CSS link to the HEAD of your HTML file&period; &ast;&sol;<br &sol;>&NewLine;<&sol;style>&NewLine;<div id&equals;"mc&lowbar;embed&lowbar;signup">&NewLine;<form id&equals;"mc-embedded-subscribe-form" class&equals;"validate" action&equals;"https&colon;&sol;&sol;saphcmsolutions&period;us3&period;list-manage&period;com&sol;subscribe&sol;post&quest;u&equals;9946caca159afc9a77502e9a5&amp&semi;id&equals;ba2e54e4b1" method&equals;"post" name&equals;"mc-embedded-subscribe-form" novalidate&equals;"" target&equals;"&lowbar;blank">&NewLine;<div id&equals;"mc&lowbar;embed&lowbar;signup&lowbar;scroll"><label for&equals;"mce-EMAIL">Stay tuned with our best practices and top-notch advices<&sol;label><br &sol;>&NewLine;<input id&equals;"mce-EMAIL" class&equals;"email" name&equals;"EMAIL" required&equals;"" type&equals;"email" value&equals;"" placeholder&equals;"email address" &sol;><br &sol;>&NewLine;<&excl;-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--><&sol;p>&NewLine;<div style&equals;"position&colon; absolute&semi; left&colon; -5000px&semi;" aria-hidden&equals;"true"><input tabindex&equals;"-1" name&equals;"b&lowbar;9946caca159afc9a77502e9a5&lowbar;ba2e54e4b1" type&equals;"text" value&equals;"" &sol;><&sol;div>&NewLine;<div class&equals;"clear"><input id&equals;"mc-embedded-subscribe" class&equals;"button" name&equals;"subscribe" type&equals;"submit" value&equals;"Subscribe" &sol;><&sol;div>&NewLine;<&sol;div>&NewLine;<&sol;form>&NewLine;<&sol;div>&NewLine;<p><&excl;--End mc&lowbar;embed&lowbar;signup--><&sol;p>&NewLine;<pre class&equals;"lang&colon;abap decode&colon;true" title&equals;"ZXHALU04">&ast;&amp&semi;---------------------------------------------------------------------&ast; &NewLine;&ast;&amp&semi; Include ZXHALU04 &NewLine;&ast;&amp&semi;---------------------------------------------------------------------&ast; &NewLine;CONSTANTS&colon; c&lowbar;0294&lpar;4&rpar; TYPE c VALUE '0294'&period; &NewLine;IF INFTY&lowbar;NAME &equals; c&lowbar;0294&period; &NewLine; CALL FUNCTION 'ZCONVERT&lowbar;P0294&lowbar;TO&lowbar;Z1PA0294' &NewLine; EXPORTING &NewLine; pnnnn&lowbar;data &equals; pnnnn&lowbar;data &NewLine; IMPORTING &NewLine; converted &equals; converted &NewLine; subrc &equals; subrc &NewLine; TABLES &NewLine; error&lowbar;tab &equals; error&lowbar;message &NewLine; CHANGING &NewLine; sdata&lowbar;data &equals; sdata&lowbar;data &NewLine; EXCEPTIONS &NewLine; OTHERS &equals; 0&period; &NewLine;ENDIF&period;<&sol;pre>&NewLine;<pre class&equals;"lang&colon;abap decode&colon;true " title&equals;"ZXHALU05">&ast;&amp&semi;---------------------------------------------------------------------&ast; &NewLine;&ast;&amp&semi; Include ZXHALU05 &NewLine;&ast;&amp&semi;---------------------------------------------------------------------&ast; &NewLine;CONSTANTS&colon; c&lowbar;0294&lpar;4&rpar; TYPE c VALUE '0294'&period; &NewLine;IF INFTY&lowbar;NAME &equals; c&lowbar;0294&period; &NewLine; &NewLine; CALL FUNCTION 'ZCONVERT&lowbar;Z1PA0294&lowbar;TO&lowbar;P0294' &NewLine; EXPORTING &NewLine; SDATA&lowbar;DATA &equals; sdata&lowbar;data &NewLine; IMPORTING &NewLine; PNNNN&lowbar;DATA &equals; pnnnn&lowbar;data &NewLine; CONVERTED &equals; converted &NewLine; SUBRC &equals; subrc &NewLine; TABLES &NewLine; ERROR&lowbar;TAB &equals; error&lowbar;message &NewLine; &period; &NewLine; &NewLine;ENDIF&period;<&sol;pre>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<pre class&equals;"lang&colon;abap decode&colon;true " title&equals;"FUNCTION ZCONVERT&lowbar;P0294&lowbar;TO&lowbar;Z1PA0294&period;">FUNCTION ZCONVERT&lowbar;P0294&lowbar;TO&lowbar;Z1PA0294&period; &NewLine;&ast;"---------------------------------------------------------------------- &NewLine;&ast;"&ast;"Local Interface&colon; &NewLine;&ast;" IMPORTING &NewLine;&ast;" VALUE&lpar;PNNNN&lowbar;DATA&rpar; &NewLine;&ast;" EXPORTING &NewLine;&ast;" VALUE&lpar;CONVERTED&rpar; TYPE C &NewLine;&ast;" VALUE&lpar;SUBRC&rpar; LIKE SY-SUBRC &NewLine;&ast;" TABLES &NewLine;&ast;" ERROR&lowbar;TAB STRUCTURE HRALE&lowbar;ERR &NewLine;&ast;" CHANGING &NewLine;&ast;" VALUE&lpar;SDATA&lowbar;DATA&rpar; &NewLine;&ast;"---------------------------------------------------------------------- &NewLine; &NewLine; DATA&colon; BEGIN OF sdata&lowbar;long&comma; &NewLine; sdata LIKE edidd-sdata&comma; &NewLine; sdata2 LIKE edidd-sdata&comma; &NewLine; sdata3 LIKE edidd-sdata&comma; &NewLine; END OF sdata&lowbar;long&period; &NewLine; &NewLine; DATA&colon; i0294 LIKE p0294&period; "workarea for infotype &NewLine; DATA&colon; z1pa0294 LIKE z1pa0294&period; "workarea for segmenttype &NewLine; DATA&colon; z1pb0294 LIKE z1pb0294&period; "workarea for segmenttype &NewLine; &NewLine; DATA&colon; act&lowbar;subrc LIKE sy-subrc&period; &NewLine; &NewLine; FIELD-SYMBOLS&colon; &lt&semi;wplog&gt&semi; TYPE ANY&period; &NewLine; &NewLine; CLEAR subrc&period; &NewLine; &NewLine;&ast; fill workarea for infotype with infotype-data &NewLine; ASSIGN pnnnn&lowbar;data TO &lt&semi;wplog&gt&semi; CASTING TYPE p0294&period; &NewLine; i0294 &equals; &lt&semi;wplog&gt&semi;&period; &NewLine; &NewLine; sdata&lowbar;long &equals; sdata&lowbar;data&period; &NewLine; ASSIGN sdata&lowbar;long-sdata TO &lt&semi;wplog&gt&semi; CASTING TYPE z1pa0294&period; &NewLine; z1pa0294 &equals; &lt&semi;wplog&gt&semi;&period; &NewLine; ASSIGN sdata&lowbar;long-sdata2 TO &lt&semi;wplog&gt&semi; CASTING TYPE z1pb0294&period; &NewLine; z1pb0294 &equals; &lt&semi;wplog&gt&semi;&period; &NewLine; &NewLine;&ast; move fields &NewLine; MOVE-CORRESPONDING i0294 TO z1pa0294&period; &NewLine; MOVE-CORRESPONDING i0294 TO z1pb0294&period; &NewLine; &NewLine;&ast; fill IDoc-data with workarea for segmenttype &NewLine; IF subrc &equals; 0&period; &NewLine; assign sdata&lowbar;long-sdata to &lt&semi;wplog&gt&semi; casting type z1pa0294&period; &NewLine; &lt&semi;wplog&gt&semi; &equals; z1pa0294&period; &NewLine; assign sdata&lowbar;long-sdata2 to &lt&semi;wplog&gt&semi; casting type z1pb0294&period; &NewLine; &lt&semi;wplog&gt&semi; &equals; z1pb0294&period; &NewLine; &NewLine; sdata&lowbar;data &equals; sdata&lowbar;long&period; &NewLine; ENDIF&period; &NewLine; &NewLine;&ast; set or initialize conversion flag &NewLine; converted &equals; 'X'&period; &NewLine; &NewLine;ENDFUNCTION&period;<&sol;pre>&NewLine;<pre class&equals;"lang&colon;abap decode&colon;true " title&equals;"FUNCTION ZCONVERT&lowbar;Z1PA0294&lowbar;TO&lowbar;P0294&period;">FUNCTION ZCONVERT&lowbar;Z1PA0294&lowbar;TO&lowbar;P0294&period; &NewLine;&ast;"-------------------------------------------------------------------- &NewLine;&ast;"&ast;"Local Interface&colon; &NewLine;&ast;" IMPORTING &NewLine;&ast;" VALUE&lpar;SDATA&lowbar;DATA&rpar; &NewLine;&ast;" EXPORTING &NewLine;&ast;" VALUE&lpar;PNNNN&lowbar;DATA&rpar; &NewLine;&ast;" VALUE&lpar;CONVERTED&rpar; TYPE C &NewLine;&ast;" VALUE&lpar;SUBRC&rpar; LIKE SY-SUBRC &NewLine;&ast;" TABLES &NewLine;&ast;" ERROR&lowbar;TAB STRUCTURE HRALE&lowbar;ERR &NewLine;&ast;"-------------------------------------------------------------------- &NewLine; &NewLine; DATA&colon; BEGIN OF sdata&lowbar;long&comma; &NewLine; sdata LIKE edidd-sdata&comma; &NewLine; sdata2 LIKE edidd-sdata&comma; &NewLine; sdata3 LIKE edidd-sdata&comma; &NewLine; END OF sdata&lowbar;long&period; &NewLine; &NewLine; DATA&colon; i0294 LIKE p0294&period; "workarea for infotype &NewLine; DATA&colon; z1pa0294 LIKE z1pa0294&period; "workarea for segmenttype &NewLine; DATA&colon; z1pb0294 LIKE z1pb0294&period; "workarea for segmenttype &NewLine; &NewLine; &NewLine; DATA&colon; act&lowbar;subrc LIKE sy-subrc&period; &NewLine; &NewLine; FIELD-SYMBOLS&colon; &lt&semi;wplog&gt&semi; TYPE ANY&period; &NewLine; &NewLine; CLEAR subrc&period; &NewLine; &NewLine;&ast; fill workarea for segmenttype with IDoc-data &NewLine; sdata&lowbar;long &equals; sdata&lowbar;data&period; &NewLine; ASSIGN sdata&lowbar;long-sdata TO &lt&semi;wplog&gt&semi; CASTING TYPE z1pa0294&period; &NewLine; z1pa0294 &equals; &lt&semi;wplog&gt&semi;&period; &NewLine; ASSIGN sdata&lowbar;long-sdata2 TO &lt&semi;wplog&gt&semi; CASTING TYPE z1pb0294&period; &NewLine; z1pb0294 &equals; &lt&semi;wplog&gt&semi;&period; &NewLine; &NewLine; &NewLine;&ast; move fields &NewLine; MOVE-CORRESPONDING z1pa0294 TO i0294&period; &NewLine; MOVE-CORRESPONDING z1pb0294 TO i0294&period; &NewLine; &NewLine;&ast; fill infotype-data with workarea for infotype &NewLine; IF subrc &equals; 0&period; &NewLine; ASSIGN pnnnn&lowbar;data TO &lt&semi;wplog&gt&semi; CASTING TYPE p0294&period; &NewLine; &lt&semi;wplog&gt&semi; &equals; i0294&period; &NewLine; ENDIF&period; &NewLine; &NewLine;&ast; set or initialize conversion flag &NewLine; converted &equals; 'X'&period; &NewLine; &NewLine;ENDFUNCTION&period;<&sol;pre>&NewLine;

Exit mobile version