Code to submit a structure and hold it in BGJOB(ASAP)
Hi ,
I have to pass a structure of values into the BGprogram through a submit and do a couple of loops in the BGPROGRAM.
I need the syntax for submit .
I also need to know how to catch the structure with values in the BGPROGRAM.
Anyone please answer ASAP
Hi,
Syntax
SUBMIT <rep> [AND RETURN] [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>]
[LINE-SIZE <width>]
[LINE-COUNT <length>].
Calls the program <rep>. If you omit the AND RETURN addition, the current program is terminated. Otherwise, the data from the current program is retained, and processing returns to the calling program when <rep> has finished running. The other additions control the selection screen and set attributes of the default list in the called program.
Regards,
Bhaskar
Similar Messages
-
I need to make a task with less as3 code and more timeline structure and event dispatcher !
I went to an interview in a big company. I had to make a task in which there is a wall with 3 lines and 5 columns filled with bombs.When you click on a bomb the bomb changes its scale, a robot enters, goes under the bomb and takes it, then goes to a smaller wall, makes the bomb smaller and place it at the same place it had been in the previous wall.I made the task with tween througout as3 code.The interviewer told me it was good but i need to make it with the less code possible and with more complex timeline structure and to use event dispatcher.What is the best way to do this ?
The immediate thing that comes to mind is they might want to see that you can balance work between design teams and development teams.
To do that, the robots movements (pick up bomb, bomb grows/shrinks, arms/treads/legs moving, sequences of 'doing things') can be timeline based so animators can work on those separate from code.
Developers would be working on the logic of keeping score, moving the robot around to the correct spot with path detection, collision detection, etc.
It's very similar to thinking in simple factories (which Flash is good at being automatically with timelines), and a bit of MVC (or just VC in some cases).
Big companies have lots of different types of employees so you'll probably be very specific in your role so you're efficient. -
Trying to register with ePrint and getting error code.Ajax submit failed: error = 403, Forbidden. I need help??
To bypass this error attempt either a restart of your computer, or use an alernate broser such as firefox or chrome. If you already have another browser the latter may be the easier fix.
Jon-W
I work on behalf of HP
Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
Click the KUDOS STAR on the left to say “Thanks” for helping! -
Why is my location city changed by Firefox to a town I don't live in? I put in my zip code in the weather info and it will not hold it no matter what I do. This is very frustrating and never a problem in the past. IE doesn't have the problem. Can anyone help?
1) Is it a video clip? Something you recognize? To be clear, it's displaying at a point in your exported movie but doesn't appear at all in the sequence?
2) What are your sequence settings? Right-click your sequence and choose "Item Properties" to verify. -
How to pass values in dynamic structure and then dynamic table
Hi,
we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic table type is any its not allowing an index operation like modify etc etc.
Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.Hi Friends,
This is the piece of code.After creating dynamic work area and dynamic table what i should do?
TYPES: BEGIN OF STR,
ID TYPE I,
NAME(30) TYPE C,
END OF STR.
data: v_lines type i.
STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
STR_COMP = STR_TYPE->GET_COMPONENTS( ).
APPEND LINES OF STR_COMP TO COMP_TAB.
COMP-NAME = 'NAME1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
P_LINE_TYPE = NEW_STR
P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
P_UNIQUE = ABAP_FALSE ).
CREATE DATA DREF TYPE HANDLE NEW_TAB.
CREATE DATA DREF1 TYPE HANDLE NEW_str. -
ABAP code to submit RFBIBL00 prog .
Can anyone help me with the ABAP code to submit RFBIBL00 prog .
Conversion program for RFBIBL00 to post financial Documents using *
TCode FB01
This program is getting only one line item for one transaction...Logic is
applied for reconcilialtion
reconciliation - to make balance zero *
REPORT zrfbib_conv .
DATA: BEGIN OF bgr00. "BI strucutre in RFBIBL00
INCLUDE STRUCTURE bgr00.
DATA: END OF bgr00.
DATA: BEGIN OF bbkpf. " Header Structure in RFBIBL00
INCLUDE STRUCTURE bbkpf.
DATA: END OF bbkpf.
DATA: BEGIN OF bbseg. " Line Item Structure in RFBIBL00
INCLUDE STRUCTURE bbseg.
DATA: END OF bbseg.
*File in Application Server
DATA: output_file_name LIKE rfpdo-rfbifile VALUE 'J:\EXCER'.
*Data declaration for passing values to screen of RFBIBL00
DATA: callmode VALUE 'B', "BDC MODE
max_comm(4) VALUE '1000', "COMMIT
pa_xprot,
anz_mode LIKE rfpdo-allgazmd VALUE 'N', Display Mode
update LIKE rfpdo-allgvbmd VALUE 'S', Update Mode
tab1 TYPE i,
in_tab TYPE i,
fl_check,
flag TYPE c.
CONSTANTS: exp_acc(3) VALUE '800'.
DATA: BEGIN OF itab1 OCCURS 0,
bldat LIKE bkpf-bldat,
blart LIKE bkpf-blart, Document Type
bukrs LIKE bkpf-bukrs, Company Code
budat LIKE bkpf-budat,
waers LIKE bkpf-waers, Currency Key
bschl LIKE bseg-bschl, posting Key
hkont LIKE bseg-hkont, Account Number
wrbtr(17) TYPE c, Transactional Amount
sgtxt LIKE bseg-sgtxt, Text
END OF itab1.
DATA: itab LIKE itab1 OCCURS 0 WITH HEADER LINE,
wa_itab LIKE itab1.
SELECTION-SCREEN: BEGIN OF BLOCK blk.
PARAMETERS: fname TYPE rlgrap-filename,
poutput LIKE rfpdo1-f05xicpd DEFAULT 'PAY',
pgroup LIKE bgr00-group DEFAULT 'FBPRAC',
pusnam LIKE bgr00-usnam DEFAULT sy-uname,
pxkeep LIKE bgr00-xkeep DEFAULT 'X',
pstart LIKE bgr00-start DEFAULT space,
ptcode LIKE blf00-tcode DEFAULT 'FB01',
XLOG(1) TYPE C DEFAULT 'X'.
SELECTION-SCREEN: END OF BLOCK blk.
Select File to upload data into internal table
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = 'ZRFBIB_CONV'
dynpro_number = '1000'
field_name = 'FNAME'
IMPORTING
file_name = fname.
START-OF-SELECTION.
*Upload data from legacy to itab
PERFORM upload_data.
Open App File
OPEN DATASET output_file_name FOR OUTPUT IN TEXT MODE.
IF sy-subrc <> 0.
WRITE:/ 'FILE COULD NOT BE OPENED'.
ENDIF.
Populate data into bgr00 structure
PERFORM populate_bgr00.
*Load data
PERFORM load_data.
*& Form upload_data
FORM upload_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = fname
filetype = 'DAT'
TABLES
data_tab = itab1
ENDFORM. " upload_data
*& Form populate_bgr00
Subroutine to populate data in bgr00 structure
FORM populate_bgr00.
bgr00-stype = '0'. "BI Record
bgr00-group = pgroup. "BDC Group
bgr00-mandt = sy-mandt. "Client
bgr00-usnam = pusnam. "User Id
bgr00-start = pstart. "Queue Start Date
bgr00-xkeep = pxkeep. "Keep Session
bgr00-nodata = '/'.
TRANSFER bgr00 TO output_file_name.
ENDFORM. " populate_bgr00
*& Form load_data
Actual load logic start in this subroutine
FORM load_data.
LOOP AT itab1.
REFRESH itab.
***For the purpose of reconciliation,split the bschl and HKONT into 2
***line items
MOVE-CORRESPONDING: itab1 TO wa_itab.
APPEND wa_itab TO itab.
**For the purpose of reconciliation,do as below
IF wa_itab-bschl = '50'.
wa_itab-bschl = '40'.
ELSE.
wa_itab-bschl = '50'.
ENDIF.
APPEND wa_itab TO itab.
READ TABLE itab INDEX 1.
*populate data in bbkpf
PERFORM populate_bbkpf.
LOOP AT itab.
*populate data in bbseg.
PERFORM populate_bbseg.
ENDLOOP.
CLEAR: itab, itab1.
*Submit to program rfbibl00
SUBMIT rfbibl00 WITH ds_name = output_file_name "File name
WITH fl_check = fl_check "File check
WITH callmode = callmode "BDC Mode
WITH max_comm = max_comm "Max Commit
WITH pa_xprot = pa_xprot "Extended Log
WITH anz_mode = anz_mode " Display Mode
WITH update = update "Update Mode
WITH XLOG = XLOG "Display Log
AND RETURN.
ENDLOOP.
ENDFORM. " load_data
*& Form populate_bbkpf
text
FORM populate_bbkpf.
TRANSLATE bbkpf USING ' /'.
bbkpf-stype = '1'. " BI Interface Record
bbkpf-tcode = ptcode. " Transaction Code
bbkpf-bldat = '31122004'. " Document Date
bbkpf-budat = '31122004'. " Posting Date
bbkpf-blart = itab-blart. " Document Type
bbkpf-bukrs = itab-bukrs. " Company Code
bbkpf-waers = itab-waers. " Currency
BBKPF-XBLNR = 'PAYROLL'. " Reference Document
bbkpf-sende = '/'. " Record End Indicator
TRANSFER bbkpf TO output_file_name. "Transfer to App Server File
ENDFORM. " populate_bbkpf
*& Form populate_bbseg
FORM populate_bbseg.
CLEAR bbseg.
TRANSLATE bbseg USING ' /'.
*Document Detail For Accounting Document
bbseg-stype = '2'. "Batch Input Interface Record
bbseg-tbnam = 'BBSEG'.
bbseg-wrbtr = itab-wrbtr. "Amount in Local Currency
bbseg-sgtxt = itab-sgtxt. "Line Item Text
bbseg-newbs = itab-bschl. "Posting Key for Next Line
bbseg-newko = itab-hkont.
bbseg-sende = '/'. "Record End Indicator
TRANSFER bbseg TO output_file_name. Transfer data from itab to App file
ENDFORM. " populate_bbseg -
Phantom click-and-hold on Dock - why?
Hi all! I've actually had this problem for so long, I don't recall when it exactly started - but when purchase of a new Magic Mouse didn't change the behaviour, I decided to finally hit the support boards.
Often, but with no predictability, I click - ONCE - on a Dock icon, only to have the screen darken and the options bubble come up instead of simply switching to that app. The second time i click, it invariably works fine. For the life of me I swear I'm not clicking any differently either time.
Like I say, this is random and seemingly impossible to reproduce on cue, but it happens ALL the time.
For all I know, this is behaviour that also happens elsewhere, but it's only on the dock that this press-and-hold action seems to ever actually do anything - though I never intentionally press-hold on the Dock, I see that if I do that, this behaviour always occurs - at least with running apps. On non-running apps, a different kind of options list comes up and is not accompanied by screen darkening.
Perhaps it's related to Expose?
Anyway - very strange and if anyone else has experienced this I'd love to hear about it.
Thanks!
PS - Snow Leopard 10.6.8.Hi
If you could send an example code, how it is done, maybe somebody will help.
Pawel -
Fields missing in MPD report after change to structure and program
I have been working on a consistency report for transaction MPD.
I had created a structure in SE11 for handling the data. it was all working, but then i had to go and change the name of the fields in the structure. Now those fields are missing from the report.
When i step through the debugger, all the fields are being populated correctly, but these fields are not displayed on screen. if i change the field names back in the structure and change the code for populating these fields, they appear okay.
i have created a custom implementation within BAdi MPD_WKB_REPORTING.
i have checked the config and it all points to my Z Structure and Z Table Type. I have logged off and logged back on! made sure my code is saved and activated...
any ideas on how i can display these new fields names/values?
Just for clarity, the field name has changed. not the linked data type.thanks for your response, however those notes and program have not done anything to assist my issue.
i have found the anwser now!
within the BAdi was a method i had to amend: IF_EX_MPD_WKB_REPORTING~GET_ALV_PARAMETERS
all fixed now! -
I have, a 2011 macbook pro with osx lion, last year it died, by doing the not getting past the logo and startup gear, i tried doing the data screen repair where u type some code and try and repair, that didnt work so i took it to genius bar and it wasnt in warrenty and they were gonna charge me but as was only 3 weeks over the warrenty period, so they did for free, and the harddrive they installed had a 90 day warrenty and that is ova now, and my mac has now done the same thing again and this time i think was a power interruption at some point and now has a fault, another thing that crossed my mind is that yes this has done this but could they have (to save money and not right offf a new one) given me my same harddrive back and jus wiped it now 5 months down the track its broken again?
The laptop isnt even 18 months old and has broken down twice, my old macbook had 4 5 years not a hiccup.
In conclusion i need to get photoes off it and cant seem to activate safe mode, or do i know how to access the startup disk that the guy did at genius last time, or get to the data screeen that allowed me to attempt to repair the drive. Can someone help me please, i have tried command r and holding shift, meither have worked.It's hard to know whether your hard drive has actually failed or if your system has just gotten badly corrupt. If the former, unfortunately, there may be no way to get any data off the drive at this point. If there aren't any backups of that data, it will be gone forever, unless perhaps a high-priced (ie, in the thousand dollar range) data recovery service has some luck with it.
If the system and/or hard drive are badly corrupt, the same may be true. Some or all of that data may be irrevocably corrupt by now. However, there are some ways that you can attempt to recover from this situation without paying such huge fees. First, if you have access to another Mac, and both have Firewire ports, you can connect the two using Firewire target disk mode. This will mount the damaged drive as if it were an external hard drive on the second Mac, and could allow you to copy some data from the drive.
Another possibility would be to buy an external hard drive, install Mac OS X on it and boot the machine from that, then copy any data from there that you can.
In both of these cases, it may be helpful to scan the damaged drive for recoverable files using something like Data Rescue.
There are also some possible ways to repair the drive if you can't do either of those things, but any repairs at this point could potentially destroy data. I only recommend this as a last resort. Still, if all other options have failed, try repairing the drive using DiskWarrior. This can fix problems that Disk Utility (and fsck, the command-line tool that it sounds like you may have used) cannot. It is possible that DiskWarrior will be able to get the drive back in working order long enough to get the data recovered, though of course it's also possible the process will be destructive.
If none of the above work, you'll have to seek professional help. -
How can I configure a party such that this party can submit both 4010 and 5010 transaction?
I try to configure a party such that this party can submit both 4010 and 5010 transactions.
I encounter error related to ISA11 field.
When I submit a 4010 transaction, I need to uncheck the 'Use ISA11 as repetition separator' box in the X12 Interchange Processing Properties page of the party. If not I will encounter error if the character 'U' in ISA11 appears as content inside
the transaction.
On the other hand, if I submit a 5010 transaction and left the 'Use ISA11 as repetition separator' box uncheck, I will encounter the following error:
Error: 2 (Field level error)
SegmentID: ISA
Position in TS: 1
Data Element ID: ISA11
Position in Segment: 11
Data Value: ^
7: Invalid code value.
The character in ISA11 in 5010 transaction is '^'.
Is there any setting or trick I can use such that I don't have to adjust the 'Use ISA11 as repetition separator' box everytime a different version of EDI is submitted by the party.Hi,
The problem you are describing is not because of Version of the document but actually it is because of different kind of ISA11s you are using for one party. It can happen with the same verion document as well.
So for solving it You can right a pipline component and put it before edi-receive pipeline component. In this pipline component you can search ISA11 and replace with 'U' if you do not want to use it.
But I think the problem will come further becauase if you have '^' in ISA11 then most probably you would be using it in document as repetition separator. So please check if you are not using '^' in the doc and then apply this pipeline component.
Thanks
Gyan
If this answers your question, please mark it as "Answered". -
How can i point to a specific field in DEEP structure and populate it?
Hello,
I have declared a internal table as below,
DATA: BEGIN OF wa_data,
vkorg TYPE vkorg
vtweg TYPE vtweg
spartTYPE spart
field_name TYPE CHAR30
value TYPE CHAR50
END OF wa_data
DATA: ls_data TYPE wa_data,
lt_data TYPE STANDARD TABLE OF wa_data.
The lt_data is populated as below,
VKORG-------VTWEG-------SPART-------FIELD_NAME-------VALUE
1000-----------10-------------01------------KALKS---------------ZP00 "Pricing procedure
1000-----------10-------------01------------ZTERM---------------15 days "Payment terms
1000-----------10-------------01------------MAHNA---------------09 "Dunning
Fine.
Now, i have a DEEP DEEP DEEP structure as belowm
DATA: ls_deep TYPE cmds_ei_extern. "Pls. see this deep structure 'cmds_ei_extern' in SAP DDIC / SE11
This deep structure is part of Customer master creation. Now, i would like to POPULATE this deep structure from my lt_data itab DYNAMICALLy, i mean, with out mentioning the field names (like, ZTERM, KALKS, MAHNA etc etc), bcz its these i am pulling this lt_data from a custom table, so going further business may also ADD a new record / field like BUSAB (Accouting clerk) with a value of AL (Allen Christi), hence i want to hv dynamic and its less tediuos also bcz,
We can LOOP lt_data INTO ls_data (for example, the ls_data-field_name = KALKS)
Now, point the KALKS in the deep deep deep structure and populate it with a value of ls_data-value (= 15 days)
ENDLLOOP.
Pls. let me know How can i do this, i guess, we need to use field symbols, pls. let me know the code to achieve my requirement
Thank youHi,
Please refer below code.This will populate field kunnr of the deep structure. Once you select the data as per your requirement,you can write similar code to populate rest of the fields in the deep strucure.
TYPES : BEGIN OF ty_data,
kunnr TYPE kunnr,
END OF ty_data.
FIELD-SYMBOLS : <lfs_cmds_ei_header> TYPE cmds_ei_header,
<lfs_cmds_ei_instance> TYPE cmds_ei_instance,
<lfs_kunnr> TYPE kunnr.
DATA: lfs_cmds_ei_extern TYPE cmds_ei_extern,
lr_dytable TYPE REF TO data,
lr_dytable_wa TYPE REF TO data,
lt_data TYPE STANDARD TABLE of ty_data ,
wa_data TYPE ty_data.
SELECT kunnr
FROM yalb_kunde
UP TO 1 ROWS
INTO TABLE lt_data.
IF sy-subrc = 0.
LOOP AT lt_data INTO lwa_data.
ASSIGN COMPONENT 'HEADER' OF STRUCTURE lfs_cmds_ei_extern TO <lfs_cmds_ei_header>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'OBJECT_INSTANCE' OF STRUCTURE <lfs_cmds_ei_header> TO <lfs_cmds_ei_instance>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <lfs_cmds_ei_instance> TO <lfs_kunnr>.
IF sy-subrc = 0.
<lfs_kunnr> = lwa_data-kunnr.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
Thanks,
Priya -
Dynamic Structure and Components Issue
Hi,
I have a requirement of creating an inbound idoc program and populating dynamic structures. The program for the dynamic structure creation is as follows: ( I have been referencing Heilmans Blog ): The part for the inbound idoc creation works fine. The data will come in a flat file with Table name and 15 characterstcis. The table name is known at runtime. I need to create the dynamic table, find out the components and then populate the custom table with the dynamically created structures.
Custom table: 4 components
Internal table from file: 15 components with value.
There could be more than one table in the flat file and not all components or char in the flat file is mapped to the table.
I have been able to code the part where the components in the structure and the file components are in the same order. The problem is if the components in the structure and the file components are not in the same order. I would appreciate some inputs in this issue.
The part that has to be worked out is:
IF NOT L_TABNAME IS INITIAL.
perform get_structure.
perform create_dynamic_itab.
perform get_data.
ENDIF.
*& Report /FACTGLB/GTDMI_VARTAB_IDOCS02 *
PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
DEVELOPER: Aveek Ghose
CREATION DATE: 2008-07-02
RDD NUMBER: DCDD027
TRANSPORT NUMBER(S): RD2K902769
*-- REVISION HISTORY -
DEVELOPER:
DATE APPLIED: YYYY-MM-DD
SCR NUMBER: <Scope Change Request ID>
RDD NUMBER: <Toolset Object ID>
TRANSPORT NUMBER(S):
DESCRIPTION:
REPORT ZGTDMI_VARTAB_IDOCS_DYNAMIC
NO STANDARD PAGE HEADING
LINE-SIZE 150
LINE-COUNT 55
MESSAGE-ID zfactglb.
**Include for Global Data Declaration
*INCLUDE /FACTGLB/GTDMI_VARTAB_TOP02.
**Include for Selection Screen
*INCLUDE /FACTGLB/GTDMI_VARTAB_SEL02.
**Include for Sub Routines
*INCLUDE /FACTGLB/GTDMI_VARTAB_FORMS02.
*& Include /FACTGLB/GTDMI_VARTAB_TOP02 *
*& Include /FACTGLB/GTDMI_VARTAB_TOP02 *
*& Include /FACTGLB/GTDMI_VARTAB_TOP
*& Include /FACTGLB/GTDMI_VARTAB_TOP
PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
DEVELOPER: Aveek Ghose
CREATION DATE: 2008-07-02
RDD NUMBER: DCDD027
TRANSPORT NUMBER(S): RD2K902769
*-- REVISION HISTORY -
DEVELOPER:
DATE APPLIED: YYYY-MM-DD
SCR NUMBER: <Scope Change Request ID>
RDD NUMBER: <Toolset Object ID>
TRANSPORT NUMBER(S):
DESCRIPTION:
TYPE POOLS
*Type declaration for ALV display
TYPE-POOLS : slis.
Include .
type-pools: col, "#EC *
icon, "#EC *
sym, "#EC *
abap. "#EC *
Target structure definitions
tables:
E1CUVTM, "#EC *
E1DATEM, "#EC *
E1CUV1M, "#EC *
edp21, "#EC *
edi_dc40, "#EC *
edi_dd40, "#EC *
edi_ds40. "#EC *
GLOBAL TYPES
TYPES : BEGIN OF ty_vartab.
include structure E1CUVTM.
TYPES: END OF ty_vartab.
TYPES : BEGIN OF ty_vartabdate.
INCLUDE STRUCTURE E1DATEM.
TYPES : END OF ty_vartabdate.
*Structure for data retreived
TYPES : BEGIN OF ty_vardetails.
INCLUDE STRUCTURE E1CUV1M.
TYPES : END OF ty_vardetails.
*Structure for data retreived from table tabinput.
TYPES : BEGIN OF ty_tabinput,
lines type string,
END OF ty_tabinput.
*Structure for data retreived from Table dsn_input.
TYPES : BEGIN OF ty_dsninput, "#EC *
LINE(101) type c,
END OF ty_dsninput.
*Structure for data retreived from Table dsn_input.
TYPES : BEGIN OF ty_newinput, "#EC *
LINE(101) type c,
flag(1) type c,
END OF ty_newinput.
*Structure for keeping the values of all the custom tables
TYPES : BEGIN OF ty_custom_tabs,
matnr TYPE matnr, "Material Number
werks TYPE werks_d, "Plant
lgort TYPE lgort_d, "Storage Location
qunty TYPE P DECIMALS 2, "Standard Order Quantity
det_loc TYPE CHAR6, "Detail Location
class TYPE CHAR2, "Class
rate TYPE P DECIMALS 2, "Rate
END OF ty_custom_tabs.
*Type declared for the internal table and work area which will store
*fields for error log
TYPES : BEGIN OF ty_error_log,
matnr TYPE matnr, "Material Number
mtart TYPE mtart, "Material Type
sel_data TYPE char10, "No of selectyed data
END OF ty_error_log.
*Structure for keeping the output data
TYPES : BEGIN OF ty_final,
VTNAM(018) type C,
CHAR1(030) type C,
CHAR2(030) type C,
CHAR3(030) type C,
CHAR4(030) type C,
CHAR5(030) type C,
CHAR6(030) type C,
CHAR7(030) type C,
CHAR8(030) type C,
CHAR9(030) type C,
CHAR10(030) type C,
CHAR11(030) type C,
CHAR12(030) type C,
CHAR13(030) type C,
CHAR14(030) type C,
CHAR15(030) type C,
FLAG(001) type C,
END OF ty_final.
TYPES: begin of TY_CONTENTHD,
VTNAM(018) type C,
FLAG(001) type C,
end of TY_CONTENTHD.
TYPES: begin of TY_CONTENT,
VTNAM(018) type C,
CHAR1(030) type C,
CHAR2(030) type C,
CHAR3(030) type C,
CHAR4(030) type C,
CHAR5(030) type C,
CHAR6(030) type C,
CHAR7(030) type C,
CHAR8(030) type C,
CHAR9(030) type C,
CHAR10(030) type C,
CHAR11(030) type C,
CHAR12(030) type C,
CHAR13(030) type C,
CHAR14(030) type C,
CHAR15(030) type C,
FLAG(001) type C,
Z_VARCOND TYPE VARCOND.
TYPES: end of TY_CONTENT.
TYPES: begin of TY_CONTENTTAB,
VTNAM(018) type C,
COMP1(30) TYPE C,
CHAR1(030) type C,
COMP2(30) TYPE C,
CHAR2(030) type C,
COMP3(30) TYPE C,
CHAR3(030) type C,
COMP4(30) TYPE C,
CHAR4(030) type C,
COMP5(30) TYPE C,
CHAR5(030) type C,
COMP6(30) TYPE C,
CHAR6(030) type C,
COMP7(30) TYPE C,
CHAR7(030) type C,
COMP8(30) TYPE C,
CHAR8(030) type C,
COMP9(30) TYPE C,
CHAR9(030) type C,
COMP10(30) TYPE C,
CHAR10(030) type C,
COMP11(30) TYPE C,
CHAR11(030) type C,
COMP12(30) TYPE C,
CHAR12(030) type C,
COMP13(30) TYPE C,
CHAR13(030) type C,
COMP14(30) TYPE C,
CHAR14(030) type C,
COMP15(30) TYPE C,
CHAR15(030) type C,
FLAG(001) type C.
TYPES: end of TY_CONTENTTAB.
TYPES: BEGIN OF TY_E1CUVTM,
MSGFN TYPE MSGFN,
VAR_TAB TYPE APITABL,
STATUS TYPE RCUTBST,
VTGROUP TYPE RCUTBGR,
AUTHSTRUC TYPE RCUTBBE,
AUTHENTRY TYPE RCUFNBI,
FLDELETE TYPE FLLKENZ,
DBTABNAME TYPE TABNAME16,
DBCONACTIVE TYPE DBCON_ACTI,
PRESDEC TYPE VTDCT,
END OF TY_E1CUVTM.
TYPES: BEGIN OF TY_E1CUV1M,
MSGFN TYPE MSGFN,
VTLINENO TYPE VTLINENO,
VTCHARACT TYPE ATNAM,
ATWRT TYPE ATWRT,
ATFLV TYPE ATFLV,
ATAWE TYPE MSEHI,
ATFLB TYPE ATFLB,
ATAW1 TYPE MSEHI,
ATCOD TYPE ATCOD,
ATTLV TYPE ATTLV,
ATTLB TYPE ATTLB,
ATPRZ TYPE ATPRZ,
ATINC TYPE ATINC,
VTLINENO5 TYPE VTLINENO5,
END OF TY_E1CUV1M.
TYPES: BEGIN OF TY_E1DATEM,
MSGFN TYPE MSGFN,
KEY_DATE TYPE SYDATUM,
AENNR TYPE AENNR,
EFFECTIVITY TYPE CC_MTEFF,
END OF TY_E1DATEM.
TYPES: BEGIN OF ty_vtnam,
vtint TYPE vtint, " Internal number of variant table
vtnam TYPE vtnam, " Name of variant table
dbtab_name type tabname16, "Custom table Name
error TYPE char1, " Indicates error in data format
reas TYPE char50, " Reason for failure
END OF ty_vtnam.
Get data type for characteristic
TYPES: BEGIN OF ty_cabn,
atinn TYPE atinn, "Internal characteristic
atnam TYPE atnam, "Characteristic Name
atfor TYPE atfor, "Data type of characteristic
atson TYPE atson, "Indicator: Additional Values
atprt TYPE atprt, "Check table
atprr TYPE atprr, "Name of Check Report Program
atprf TYPE atprf, "Function Module for Checking Values
anzdz TYPE anzdz, "Number of Decimal Places
check TYPE char1, "Indicates check required or not
END OF ty_cabn.
Get field names of variant table
TYPES: BEGIN OF ty_cuvtab_fld,
vtint TYPE vtint, " Internal number of variant table
atinn TYPE atinn, " Internal characteristic
vtpos TYPE vtpos, " Item number of characteristic in variant
*mod-012
DBFLD type NAME_FELD,
*mod-012
exist TYPE char1, " X Indictaes characteristic is part of fil
END OF ty_cuvtab_fld.
Store all data in internal table
TYPES: BEGIN OF ty_file,
vtnam TYPE vtnam,
char1 TYPE atwrt,
char2 TYPE atwrt,
char3 TYPE atwrt,
char4 TYPE atwrt,
char5 TYPE atwrt,
char6 TYPE atwrt,
char7 TYPE atwrt,
char8 TYPE atwrt,
char9 TYPE atwrt,
char10 TYPE atwrt,
char11 TYPE atwrt,
char12 TYPE atwrt,
char13 TYPE atwrt,
char14 TYPE atwrt,
char15 TYPE atwrt,
flag TYPE char1,
error TYPE char50,
END OF ty_file.
To check for duplicates
TYPES: BEGIN OF ty_dupl,
vtnam TYPE vtnam,
char1 TYPE atwrt,
char2 TYPE atwrt,
char3 TYPE atwrt,
char4 TYPE atwrt,
char5 TYPE atwrt,
char6 TYPE atwrt,
char7 TYPE atwrt,
char8 TYPE atwrt,
char9 TYPE atwrt,
char10 TYPE atwrt,
char11 TYPE atwrt,
char12 TYPE atwrt,
char13 TYPE atwrt,
char14 TYPE atwrt,
char15 TYPE atwrt,
slnid TYPE slnid,
END OF ty_dupl.
Get previously loaded characteristic values for internal table (CHAR)
TYPES: BEGIN OF ty_cuvtab_valc,
vtint TYPE vtint, " Internal number of variant table
slnid TYPE slnid, " Key for value combination in variant tab
atinn TYPE atinn, " Internal characteristic
valc TYPE atwrt, " Characteristic Value
END OF ty_cuvtab_valc.
Get previously loaded characteristic values for internal table (NUM)
TYPES: BEGIN OF ty_cuvtab_valn,
vtint TYPE vtint, " Internal number of variant table
slnid TYPE slnid, " Key for value combination in variant tab
atinn TYPE atinn, " Internal characteristic
val_from TYPE atflv, " Internal floating point from
END OF ty_cuvtab_valn.
Store column positions of characteristics
TYPES: BEGIN OF ty_col_pos,
vtint TYPE vtint, " Internal number of variant table
vtnam TYPE vtnam, " Variant table name
atinn TYPE atinn, "Internal characteristic
atnam TYPE atnam, "Characteristic Name
field TYPE fieldname, "Field name
req TYPE char1, " Required or not
vtpos TYPE vtpos, " Item number of characteristics
DBFLD type NAME_FELD, " Field Name of Custom table.
END OF ty_col_pos.
Store valid values for characteristics
TYPES: BEGIN OF ty_cawn,
atinn TYPE atinn, " Internal characteristic
atzhl TYPE atzhl, " Int counter
atwrt TYPE atwrt, " Characteristic Value
atflv TYPE atflv, " Internal floating point from
lkenz TYPE lkenz, " Deletion indicator
END OF ty_cawn.
Store error messages for individual lines
TYPES: BEGIN OF ty_error,
vtnam TYPE vtnam, " Variant table name
fname TYPE fieldname, " Fieldname
atnam TYPE atnam, " Characteristic name
atwrt TYPE atwrt, " Characteristic value
row TYPE char5, " Row id
END OF ty_error.
Begin TPR# 4618
To store unique number for variant
TYPES: BEGIN OF ty_vnt_ma,
vtnam TYPE vtnam,
unique_no TYPE ZGTDM_UNQN,
no_chr TYPE ZGTDM_NO_CHR,
END OF ty_vnt_ma.
TYPES: BEGIN OF ty_dbtab,
vtint TYPE vtint,
vtnam TYPE vtnam,
DBTAB_NAME TYPE TABNAME16,
END OF ty_dbtab.
To find out concatenated number for
TYPES: BEGIN OF ty_split,
f1 TYPE char6,
END OF ty_split.
TYPES: BEGIN OF ty_charval,
char TYPE char30,
END OF ty_charval.
TYPES: BEGIN OF TY_DATA,
name TYPE string,
value(15) type c,
END OF TY_DATA.
DATA: I_DATATAB TYPE STANDARD TABLE OF TY_DATA.
TYPES:
TUMLS_MESSTYPE type /SAPDMC/LS_MESSTYPE,
TUMLS_MESSTYPETXT type EDI_TEXT60,
TUMLS_MESSCODE type EDIPMESCOD.
TYPES:
TUMLS_TABNAME TYPE TABNAME, "#EC *
TUMLS_SEGMENT TYPE TABNAME. "#EC *
TYPES:
TUMLS_PATHFILE TYPE /SAPDMC/LS_FILENAME,
TUMLS_FILENAME TYPE /SAPDMC/LS_FILENAME,
TUMLS_FILETEXT TYPE /SAPDMC/LS_FILETEXT.
TYPES:
BEGIN OF type_errorline,
msgty type SYMSGTY,
id type SYMSGID,
msgno type symsgno,
par1 type symsgv,
par2 type symsgv,
par3 type symsgv,
par4 type symsgv,
END OF type_errorline.
TYPES:
type_errortab TYPE SORTED TABLE
OF type_errorline
WITH NON-UNIQUE KEY id msgno par1 par2 par3 par4.
DATA:
LV_INDEX TYPE SY-INDEX,
LV_INDEX2 TYPE SYINDEX,
LV_TABLE1 TYPE REF TO DATA,
LV_TABLE2 TYPE REF TO DATA,
LV_TABLE3 TYPE REF TO DATA,
LV_TABLE4 TYPE REF TO DATA,
LV_LINE1 TYPE REF TO DATA,
LV_LINE2 TYPE REF TO DATA,
LV_LINE3 TYPE REF TO DATA,
LV_LINE4 TYPE REF TO DATA,
LV_OFFSET1 TYPE SYTABIX,
ST_IS_LAYOUT_ALV TYPE SLIS_LAYOUT_ALV,
L_IT_FCATLOG_ALV TYPE SLIS_T_FIELDCAT_ALV,
L_IT_FLDCAT TYPE LVC_T_FCAT.
GLOBAL INTERNAL TABLES
DATA : i_newinput TYPE STANDARD TABLE OF ty_newinput INITIAL SIZE 0."#EC *
DATA : i_contentheader1 TYPE STANDARD TABLE OF ty_contenthd INITIAL SIZE 0."#EC *
DATA : i_contenttab1 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab2 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab3 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab4 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab5 TYPE STANDARD TABLE OF ty_contenttab INITIAL SIZE 0."#EC *
DATA : i_E1CUV1M TYPE STANDARD TABLE OF E1CUV1M INITIAL SIZE 0."#EC *
DATA : i_errortab TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
GLOBAL WORK AREAS
**Internal Table for the structure TY_T001L
DATA : wa_vartab TYPE ty_vartab. "#EC *
DATA : wa_vartabdate TYPE ty_vartabdate. "#EC *
DATA : wa_vardetails TYPE ty_vardetails. "#EC *
DATA : wa_tabinput TYPE ty_tabinput. "#EC *
DATA : wa_dsninput TYPE ty_dsninput. "#EC *
DATA : wa_newinput TYPE ty_newinput. "#EC *
DATA : wa_gnewinput TYPE ty_newinput. "#EC *
DATA : wa_ginput_data TYPE ty_newinput. "#EC *
DATA : wa_final TYPE ty_final. "#EC *
DATA : wa_content TYPE ty_content. "#EC *
DATA : wa_contenthd TYPE ty_contenthd. "#EC *
DATA : wa_contentheader type ty_contenthd. "#EC *
DATA : wa_contenttab TYPE ty_content. "#EC *
DATA : wa_content1 TYPE ty_content. "#EC *
DATA : wa_contenthd1 TYPE ty_contenthd. "#EC *
DATA : wa_contentheader1 type ty_contenthd. "#EC *
DATA : wa_contenttab1 TYPE ty_content. "#EC *
DATA : wa_contenttab2 TYPE ty_content. "#EC *'
DATA : wa_contenttab3 TYPE ty_content. "#EC *
DATA : wa_contenttab4 TYPE ty_content. "#EC *
DATA : wa_contenttab5 TYPE ty_contentTAB. "#EC *
DATA : wa_E1CUVTM TYPE E1CUVTM. "#EC *
DATA : wa_E1CUV1M TYPE E1CUV1M. "#EC *
DATA : wa_E1DATEM TYPE E1DATEM. "#EC *
DATA : wa_error_tab TYPE solisti1. "#EC *
INTERNAL TABLES AND WORK AREAS FOR BDC
*Internal Table to store the data to display the error message
DATA : i_errormsg TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
*Internal Table to store the data to display the error message
DATA : i_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
DATA : itab_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
**Work area to store the data to display the error message
DATA : wa_errormsg TYPE solisti1. "#EC *
**Internal table which will store data for the error log
DATA:i_error_log TYPE STANDARD TABLE OF ty_error_log INITIAL SIZE 0."#EC *
GLOBAL VARIABLES
DATA: G_FILE TYPE string. "#EC *
DATA : g_ctr_input_recs(5) type c. "#EC *
DATA: g_ctr_output_recs(5) type p. "#EC *
data : g_msg(100) type c. "#EC *
data: g_struct_file TYPE string. "#EC *
data: g_login type FILEINTERN. "#EC *
data: g_phyin type string. "#EC *
DATA: g_lprnt type RSPOPSHORT. "#EC *
DATA: g_FNAME1 TYPE STRING. "#EC *
DATA : g_repid TYPE repid, "#EC *
g_exit(1) TYPE C, "#EC *
gx_variant type disvariant. "#EC *
DATA : g_lines TYPE i . "#EC *
data : g_save(1) type c. "#EC *
DATA : g_splid TYPE rspoid . "#EC *
data: p_login type FILEINTERN. "#EC *
data: p_phyin type string. "#EC *
DATA:
go_table TYPE REF TO cl_salv_table,
go_sdescr TYPE REF TO cl_abap_structdescr,
go_tdescr TYPE REF TO cl_abap_tabledescr,
gdo_data TYPE REF TO data,
gdo_handle TYPE REF TO data,
gs_comp TYPE abap_componentdescr,
gt_components TYPE abap_component_tab.
FIELD-SYMBOLS:
TYPE table.
GLOBAL CONSTANTS
CONSTANTS c_msgar TYPE rslgarea VALUE 'F8'. "#EC *
CONSTANTS c_msgid TYPE rslgsubid VALUE 'E'. "#EC *
CONSTANTS c_urgnc TYPE char04 VALUE 'HIGH'. "#EC *
CONSTANTS C_X(1) TYPE C VALUE 'X'. "#EC *
CONSTANTS C_Y(1) TYPE C VALUE 'Y'. "#EC *
CONSTANTS C_Z(1) TYPE C VALUE 'Z'. "#EC *
CONSTANTS C_E(1) TYPE C VALUE 'E'. "#EC *
CONSTANTS C_SAP(3) TYPE C VALUE 'SAP'. "#EC *
CONSTANTS C_MOD(3) TYPE C VALUE 'MOD'. "#EC *
CONSTANTS C_MD1(3) TYPE C VALUE 'MD1'. "#EC *
CONSTANTS C_MD2(3) TYPE C VALUE 'MD2'. "#EC *
CONSTANTS C_MD3(3) TYPE C VALUE 'MD3'. "#EC *
CONSTANTS C_MD4(3) TYPE C VALUE 'MD4'. "#EC *
CONSTANTS C_MD5(3) TYPE C VALUE 'MD5'. "#EC *
constants: c_000001(6) type c value '000001', "#EC *
c_e1cuv1m(7) type c value 'E1CUV1M', "#EC *
c_02(2) type c value '02', "#EC *
c_009(3) type c value '009', "#EC *
c_0001(4) type c value '0001'. "#EC *
constants: c_e1datem(7) type c value 'E1DATEM'. "#EC *
constants: c_e1cuvtm(7) type c value 'E1CUVTM'. "#EC *
GLOBAL INTERNAL TABLES FOR ALV DISPLAY
*Internal tables for ALV Field cat
DATA :
i_fieldcat_ov TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
i_fieldcat_dtl TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
i_fieldcat_ov1 TYPE lvc_t_fcat, "#EC *
i_events TYPE slis_t_event. "#EC *
GLOBAL WORK AREAS FOR ALV DISPLAY
*Work area for ALV Field layout
DATA : wa_layout TYPE slis_layout_alv. "#EC *
*Work area for Field Cat. Table
DATA : wa_fieldcat TYPE slis_fieldcat_alv. "#EC *
GLOBAL VARIABLES FOR ALV DISPLAY
DATA : g_event TYPE slis_t_event. "#EC *
DATA : g_top_of_page TYPE slis_t_listheader. "#EC *
DATA : g_ok_code TYPE char4. "#EC *
DATA : g_variant type disvariant. "#EC *
GLOBAL CONSTANTS FOR ALV DISPLAY
BAL handling
data: iv_log_handle type BALLOGHNDL. "#EC *
data: is_log_header type bal_s_log. "#EC *
data: iv_object type bal_s_log-object value 'CAPI'. "#EC *
data: iv_subobject type bal_s_log-subobject value 'CAPI_LOG'."#EC *
data: iv_tcode type bal_s_log-altcode value 'SE38'. "#EC *
*MOD-005
RANGES:
R_MESTYP FOR EDIDC-MESTYP, "#EC *
R_CREDAT FOR EDIDC-CREDAT, "#EC *
R_CRETIM FOR EDIDC-CRETIM, "#EC *
R_SNDPRT FOR EDIDC-SNDPRT, "#EC *
R_SNDPRN FOR EDIDC-SNDPRN. "#EC *
DATA:
L_MESSTYPE TYPE TUMLS_MESSTYPE. "#EC *
*MOD-005
data: p_sndprn TYPE EDI_SNDPRN, "#EC *
p_sndprt TYPE EDI_SNDPRT, "#EC *
p_sndpor TYPE EDI_SNDPOR. "#EC *
data: p_rcvprn TYPE EDI_RCVPRN, "#EC *
p_rcvprt TYPE EDI_RCVPRT, "#EC *
p_rcvpor TYPE EDI_RCVPOR. "#EC *
data:
init_E1CUVTM type E1CUVTM, "#EC *
prev_E1CUVTM type E1CUVTM, "#EC *
init_E1DATEM type E1DATEM, "#EC *
prev_E1DATEM type E1DATEM, "#EC *
init_E1CUV1M type E1CUV1M, "#EC *
prev_E1CUV1M type E1CUV1M. "#EC *
Source structure definitions
data:
begin of LSMW_TAB_CONTENT, "#EC *
VTNAM(018) type C,
CHAR1(030) type C,
CHAR2(030) type C,
CHAR3(030) type C,
CHAR4(030) type C,
CHAR5(030) type C,
CHAR6(030) type C,
CHAR7(030) type C,
CHAR8(030) type C,
CHAR9(030) type C,
CHAR10(030) type C,
CHAR11(030) type C,
CHAR12(030) type C,
CHAR13(030) type C,
CHAR14(030) type C,
CHAR15(030) type C,
FLAG(001) type C,
end of LSMW_TAB_CONTENT.
Counters
data:
g_cnt_VAR_TAB type i, "#EC *
g_cnt_TAB_CONTENT type i. "#EC *
Counter ct_xxxxxxxxxx: number of transferred records
data:
ct_edi_dc40 type i, "#EC *
cs_edi_dc40 type i, "#EC *
ct_E1CUVTM type i, "#EC *
cs_E1CUVTM type i, "#EC *
ct_E1DATEM type i, "#EC *
cs_E1DATEM type i, "#EC *
ct_E1CUV1M type i, "#EC *
cs_E1CUV1M type i. "#EC *
Global data definitions and data declarations
DATA: wa_cabn TYPE ty_cabn,
wa_cawn TYPE ty_cawn,
wa_file TYPE ty_file,
wa_vtnam TYPE ty_vtnam,
wa_cuvtab_fld TYPE ty_cuvtab_fld,
wa_cuvtab_valn TYPE ty_cuvtab_valn,
wa_cuvtab_valc TYPE ty_cuvtab_valc,
wa_col_pos TYPE ty_col_pos,
wa_error TYPE ty_error,
wa_dupl TYPE ty_dupl,
wa_dupl_file TYPE ty_dupl.
DATA: wa_vnt_ma TYPE ty_vnt_ma,
wa_split TYPE ty_split.
DATA: wa_charval TYPE ty_charval. "#EC *
Internal table
DATA: i_cabn TYPE STANDARD TABLE OF ty_cabn, "#EC *
i_cabn_temp TYPE STANDARD TABLE OF ty_cabn, "#EC *
i_cabn_atinn TYPE STANDARD TABLE OF ty_cabn, "#EC *
i_file TYPE STANDARD TABLE OF ty_file, "#EC *
i_file_tmp TYPE STANDARD TABLE OF ty_file, "#EC *
i_vtnam TYPE STANDARD TABLE OF ty_vtnam, "#EC *
i_cuvtab TYPE STANDARD TABLE OF ty_vtnam, "#EC *
i_cuvtab_fld TYPE STANDARD TABLE OF ty_cuvtab_fld, "#EC *
i_cuvtab_valn TYPE STANDARD TABLE OF ty_cuvtab_valn, "#EC *
i_cuvtab_valc TYPE STANDARD TABLE OF ty_cuvtab_valc, "#EC *
i_col_pos TYPE STANDARD TABLE OF ty_col_pos, "#EC *
i_cawn TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cawn_n TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cawn_c TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cawn_i TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cuv_error TYPE STANDARD TABLE OF ty_vtnam, "#EC *
i_dupl TYPE STANDARD TABLE OF ty_dupl, "#EC *
i_dbtab TYPE STANDARD TABLE OF ty_dbtab. "#EC *
DATA: i_vnt_ma TYPE STANDARD TABLE OF ty_vnt_ma, "#EC *
i_split TYPE STANDARD TABLE OF ty_split. "#EC *
DATA: i_dupl_file TYPE STANDARD TABLE OF ty_dupl. "#EC *
DATA: i_charval TYPE STANDARD TABLE OF ty_charval. "#EC *
Constants
CONSTANTS: c_char TYPE atfor VALUE 'CHAR', "#EC *
c_date TYPE atfor VALUE 'DATE', "#EC *
c_time TYPE atfor VALUE 'TIME', "#EC *
c_varcond TYPE atnam VALUE 'Z_VARCOND'. "#EC *
Field Symbols
FIELD-SYMBOLS: TYPE ANY.
Variables
DATA: g_raw(500) TYPE c, "#EC *
g_invalid TYPE char1, "#EC *
g_error TYPE char1, "#EC *
g_message TYPE char50, "#EC *
g_slnid_c TYPE slnid, "#EC *
g_slnid_n TYPE slnid, "#EC *
g_row TYPE char5. "#EC *
DATA: g_varcond TYPE varcond, "Variant condition "#EC NEEDED
g_split_var TYPE i. "#EC *
Types: begin of ty_charname,
name type atnam,
end of ty_charname.
data: wa_charname type ty_charname, "#EC *
i_charname type standard table of ty_charname. "#EC *
data: cnt_i type i, "#EC *
g_tabix type char10. "#EC *
Types: begin of ty_itab_zedidc40.
include structure edi_dc40.
TYPES: end of ty_itab_zedidc40.
Types: begin of ty_itab_zedidd40.
include structure edi_dd40.
TYPES: end of ty_itab_zedidd40.
DATA: itab_zedidc40 type standard table of
ty_itab_zedidc40 initial size 0. "#EC *
DATA: itab_zedidd40 type standard table of
ty_itab_zedidd40 initial size 0. "#EC *
DATA: wa_itab_zedidc40 type ty_itab_zedidc40.
DATA: wa_itab_zedidd40 type ty_itab_zedidd40.
*MOD-009
data: itab_ze1cuvtm type e1cuvtm, "#EC *
itab_ze1datem type e1datem, "#EC *
itab_ze1cuv1m type e1cuv1m. "#EC *
data: wdocnum(16) type n value 0. "#EC *
data: wsegnum(6) type n value 0. "#EC *
data: witemno(10) type n value 0. "#EC *
data: witemno_new(10) type n value 0. "#EC *
data: witemno_gst(10) type n value 0. "#EC *
data: witemno_qst(10) type n value 0. "#EC *
TYPES: BEGIN OF ty_input_data1, "#EC *
line(560) type c,
flag(1) type c,
END OF ty_input_data1.
DATA: i_input_data type standard table of
ty_input_data1 initial size 0. "with header line.
DATA: i_input_data1 type standard table of
ty_input_data1 initial size 0. "with header line.
DATA: wa_input_data type ty_input_data1. "#EC *
DATA: g_cnt_input_recs type i. "#EC *
DATA: g_flg_error type c. "#EC *
DATA: l_lines type i. "#EC *
DATA: l_lines_varcond type i. "#EC *
DATA: l_lines1 type i. "#EC *
DATA: l_tabix type i. "#EC *
DATA: wa_input_data1 type ty_input_data1. "#EC *
DATA: FILE TYPE STRING.
Fields that are made available to the user:
DATA:
g_cnt_records_read TYPE i, "#EC *
g_cnt_records_transferred TYPE i, "#EC *
g_cnt_transactions_read TYPE i, "#EC *
g_cnt_transactions_transferred TYPE i, "#EC *
g_cnt_idocs_package TYPE i. "#EC *
data: v_log_handle type balloghndl. "#EC *
DATA: gt_curr_edi_dc40 TYPE STANDARD TABLE OF edi_dc40 initial size 0."#EC *
DATA: gt_curr_edi_dd40 TYPE STANDARD TABLE OF edi_dd40 initial size 0."#EC *
DATA: wa_curr_edi_dc40 TYPE edi_dc40. "#EC *
DATA: wa_curr_edi_dd40 TYPE edi_dd40. "#EC *
internal table for error messages during conversion
DATA: g_error_tab TYPE type_errortab, "#EC *
wa_errortab TYPE type_errorline. "#EC *
DATA: g_edidd_segnam type EDI4SEGNAM, "#EC *
g_edidd_hlevel type EDI4HLEVEC. "#EC *
DATA: g_segnum(6) TYPE n.
DATA: g_objecttype(2) type C.
DATA: P_FNAME(128) TYPE C VALUE '/usr/sap/trans/vartabheader'. " MODIF ID MD1 OBLIGATORY.
DATA: P_FNAME1(128) TYPE C VALUE '/usr/sap/trans/vartabcontent'. " MODIF ID MD1 OBLIGATORY.
DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
it_fldcat TYPE lvc_t_fcat.
field-symbols: .
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
data: l_wa_data TYPE TY_CONTENT,
l_tabname TYPE tabname,
itab_data TYPE standard table of TY_CONTENT.
DATA: l_len_slnid TYPE i, "#EC NEEDED
l_len_varcond TYPE i, "#EC NEEDED
l_temp_slnid TYPE i, "#EC NEEDED
l_temp_slnc TYPE char5, "#EC NEEDED
l_temp_varcond TYPE varcond, "#EC NEEDED
l_sub_var TYPE i, "#EC NEEDED
l_val_split TYPE char10. "#EC NEEDED
DATA: l_invalid. "#EC NEEDED
DECLARATION FOR SELECTION SCREEN
*selection-screen skip 1.
*For all the input field entries
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
*Parameter for Input File Name:
PARAMETERS: p_inpt TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File Variant table
PARAMETERS: p_inpt1 TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File variant Content
SELECTION-SCREEN END OF BLOCK bl1.
IDoc creation
selection-screen begin of block idocpars
with frame title text-006.
parameters:
p_trfcpt as checkbox default C_X MODIF ID MD3,
p_packge(5) type n default 1 MODIF ID MD3.
selection-screen end of block idocpars.
SELECTION-SCREEN BEGIN OF BLOCK bl5 WITH FRAME TITLE text-038.
Radio Buttons :
parameters:
rb_idocp RADIOBUTTON GROUP RB3 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD6,
rb_custt RADIOBUTTON GROUP RB3 MODIF ID MD6.
SELECTION-SCREEN END OF BLOCK bl5.
SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-032.
Radio Buttons :
parameters:
rb_apsrv RADIOBUTTON GROUP RB1 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD4,
rb_convt RADIOBUTTON GROUP RB1 MODIF ID MD4,
rb_idoc RADIOBUTTON GROUP RB1 MODIF ID MD4,
rb_proc RADIOBUTTON GROUP RB1 MODIF ID MD4.
SELECTION-SCREEN END OF BLOCK bl3.
SELECTION-SCREEN BEGIN OF BLOCK bl4 WITH FRAME TITLE text-037.
Radio Buttons :
parameters:
rb_appct RADIOBUTTON GROUP RB2 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD5,
rb_conct RADIOBUTTON GROUP RB2 MODIF ID MD5,
rb_cust RADIOBUTTON GROUP RB2 MODIF ID MD5.
SELECTION-SCREEN END OF BLOCK bl4.
INITIALIZATION
INITIALIZATION.
Check selection-screen entries *
*AT SELECTION-SCREEN.
PERFORM sub_get_physical_file USING p_fpath p_fname.
PERFORM sub_get_physical_file1 USING p_fpath1 p_fname1.
AT SELECTION SCREEN
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM sub_get_file. " CHANGING p_fname. "#EC *
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname1.
PERFORM sub_get_file1. " CHANGING p_fname1. "#EC *
AT SELECTIHi,
I now have a requirement for the following:
Duplicate VARCOND if I Use small letters and capital letters. Sequential number also duplicated.
Here is the code and would appreciate if someone could shed some light on the issue.
*& Report ZVARTABDYNFINAL
PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
DEVELOPER: Aveek Ghose
CREATION DATE: 2008-08-25
RDD NUMBER: DCDD027
TRANSPORT NUMBER(S): RD2K902769
*-- REVISION HISTORY -
DEVELOPER:
DATE APPLIED: YYYY-MM-DD
SCR NUMBER: <Scope Change Request ID>
RDD NUMBER: <Toolset Object ID>
TRANSPORT NUMBER(S):
DESCRIPTION:
REPORT ZVARTABDYNFINAL NO STANDARD PAGE HEADING
LINE-SIZE 150
LINE-COUNT 55
MESSAGE-ID /factglb/gta_custdev.
*& Include /FACTGLB/GTDMI_VARTAB_TOP02 *
*& Include /FACTGLB/GTDMI_VARTAB_TOP
*& Include /FACTGLB/GTDMI_VARTAB_TOP
PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
DEVELOPER: Aveek Ghose
CREATION DATE: 2008-08-25
RDD NUMBER: DCDD027
TRANSPORT NUMBER(S): RD2K902769
*-- REVISION HISTORY -
DEVELOPER:
DATE APPLIED: YYYY-MM-DD
SCR NUMBER: <Scope Change Request ID>
RDD NUMBER: <Toolset Object ID>
TRANSPORT NUMBER(S):
DESCRIPTION:
TYPE POOLS
TYPE POOLS
TYPE POOLS
*Type declaration for ALV display
TYPE-POOLS : slis.
Include <icon>.
type-pools: col, "#EC *
icon, "#EC *
sym, "#EC *
abap. "#EC *
Target structure definitions
tables:
E1CUVTM, "#EC *
E1DATEM, "#EC *
E1CUV1M, "#EC *
edp21, "#EC *
edi_dc40, "#EC *
edi_dd40, "#EC *
edi_ds40. "#EC *
GLOBAL TYPES
TYPES : BEGIN OF ty_vartab.
include structure E1CUVTM.
TYPES: END OF ty_vartab.
TYPES : BEGIN OF ty_vartabdate.
INCLUDE STRUCTURE E1DATEM.
TYPES : END OF ty_vartabdate.
*Structure for data retreived
TYPES : BEGIN OF ty_vardetails.
INCLUDE STRUCTURE E1CUV1M.
TYPES : END OF ty_vardetails.
*Structure for data retreived from table tabinput.
TYPES : BEGIN OF ty_tabinput,
lines type string,
END OF ty_tabinput.
*Structure for data retreived from Table dsn_input.
TYPES : BEGIN OF ty_dsninput, "#EC *
LINE(101) type c,
END OF ty_dsninput.
*Structure for data retreived from Table dsn_input.
TYPES : BEGIN OF ty_newinput, "#EC *
LINE(101) type c,
flag(1) type c,
END OF ty_newinput.
*Structure for keeping the values of all the custom tables
TYPES : BEGIN OF ty_custom_tabs,
matnr TYPE matnr, "Material Number
werks TYPE werks_d, "Plant
lgort TYPE lgort_d, "Storage Location
qunty TYPE P DECIMALS 2, "Standard Order Quantity
det_loc TYPE CHAR6, "Detail Location
class TYPE CHAR2, "Class
rate TYPE P DECIMALS 2, "Rate
END OF ty_custom_tabs.
*Type declared for the internal table and work area which will store
*fields for error log
TYPES : BEGIN OF ty_error_log,
matnr TYPE matnr, "Material Number
mtart TYPE mtart, "Material Type
sel_data TYPE char10, "No of selectyed data
END OF ty_error_log.
*Structure for keeping the output data
TYPES : BEGIN OF ty_final,
VTNAM(018) type C,
CHAR1(030) type C,
CHAR2(030) type C,
CHAR3(030) type C,
CHAR4(030) type C,
CHAR5(030) type C,
CHAR6(030) type C,
CHAR7(030) type C,
CHAR8(030) type C,
CHAR9(030) type C,
CHAR10(030) type C,
CHAR11(030) type C,
CHAR12(030) type C,
CHAR13(030) type C,
CHAR14(030) type C,
CHAR15(030) type C,
FLAG(001) type C,
END OF ty_final.
TYPES: begin of TY_CONTENTHD,
VTNAM(018) type C,
FLAG(001) type C,
end of TY_CONTENTHD.
TYPES: begin of TY_CONTENT,
VTNAM(018) type C,
CHAR1(030) type C,
CHAR2(030) type C,
CHAR3(030) type C,
CHAR4(030) type C,
CHAR5(030) type C,
CHAR6(030) type C,
CHAR7(030) type C,
CHAR8(030) type C,
CHAR9(030) type C,
CHAR10(030) type C,
CHAR11(030) type C,
CHAR12(030) type C,
CHAR13(030) type C,
CHAR14(030) type C,
CHAR15(030) type C,
FLAG(001) type C,
Z_VARCOND type VARCOND.
TYPES: end of TY_CONTENT.
TYPES: begin of TY_CONTENTTAB,
VTNAM(018) type C,
COMP1(30) TYPE C,
CHAR1(030) type C,
COMP2(30) TYPE C,
CHAR2(030) type C,
COMP3(30) TYPE C,
CHAR3(030) type C,
COMP4(30) TYPE C,
CHAR4(030) type C,
COMP5(30) TYPE C,
CHAR5(030) type C,
COMP6(30) TYPE C,
CHAR6(030) type C,
COMP7(30) TYPE C,
CHAR7(030) type C,
COMP8(30) TYPE C,
CHAR8(030) type C,
COMP9(30) TYPE C,
CHAR9(030) type C,
COMP10(30) TYPE C,
CHAR10(030) type C,
COMP11(30) TYPE C,
CHAR11(030) type C,
COMP12(30) TYPE C,
CHAR12(030) type C,
COMP13(30) TYPE C,
CHAR13(030) type C,
COMP14(30) TYPE C,
CHAR14(030) type C,
COMP15(30) TYPE C,
CHAR15(030) type C,
FLAG(001) type C.
TYPES: end of TY_CONTENTTAB.
TYPES: BEGIN OF TY_E1CUVTM,
MSGFN TYPE MSGFN,
VAR_TAB TYPE APITABL,
STATUS TYPE RCUTBST,
VTGROUP TYPE RCUTBGR,
AUTHSTRUC TYPE RCUTBBE,
AUTHENTRY TYPE RCUFNBI,
FLDELETE TYPE FLLKENZ,
DBTABNAME TYPE TABNAME16,
DBCONACTIVE TYPE DBCON_ACTI,
PRESDEC TYPE VTDCT,
END OF TY_E1CUVTM.
TYPES: BEGIN OF TY_E1CUV1M,
MSGFN TYPE MSGFN,
VTLINENO TYPE VTLINENO,
VTCHARACT TYPE ATNAM,
ATWRT TYPE ATWRT,
ATFLV TYPE ATFLV,
ATAWE TYPE MSEHI,
ATFLB TYPE ATFLB,
ATAW1 TYPE MSEHI,
ATCOD TYPE ATCOD,
ATTLV TYPE ATTLV,
ATTLB TYPE ATTLB,
ATPRZ TYPE ATPRZ,
ATINC TYPE ATINC,
VTLINENO5 TYPE VTLINENO5,
END OF TY_E1CUV1M.
TYPES: BEGIN OF TY_E1DATEM,
MSGFN TYPE MSGFN,
KEY_DATE TYPE SYDATUM,
AENNR TYPE AENNR,
EFFECTIVITY TYPE CC_MTEFF,
END OF TY_E1DATEM.
TYPES: BEGIN OF ty_vtnam,
vtint TYPE vtint, " Internal number of variant table
vtnam TYPE vtnam, " Name of variant table
dbtab_name type tabname16, "Custom table Name
error TYPE char1, " Indicates error in data format
reas TYPE char50, " Reason for failure
END OF ty_vtnam.
Get data type for characteristic
TYPES: BEGIN OF ty_cabn,
atinn TYPE atinn, "Internal characteristic
atnam TYPE atnam, "Characteristic Name
atfor TYPE atfor, "Data type of characteristic
atson TYPE atson, "Indicator: Additional Values
atprt TYPE atprt, "Check table
atprr TYPE atprr, "Name of Check Report Program
atprf TYPE atprf, "Function Module for Checking Values
anzdz TYPE anzdz, "Number of Decimal Places
check TYPE char1, "Indicates check required or not
END OF ty_cabn.
Get field names of variant table
TYPES: BEGIN OF ty_cuvtab_fld,
vtint TYPE vtint, " Internal number of variant table
atinn TYPE atinn, " Internal characteristic
vtpos TYPE vtpos, " Item number of characteristic in variant
*mod-012
DBFLD type NAME_FELD,
*mod-012
exist TYPE char1, " X Indictaes characteristic is part of fil
END OF ty_cuvtab_fld.
Store all data in internal table
TYPES: BEGIN OF ty_file,
vtnam TYPE vtnam,
char1 TYPE atwrt,
char2 TYPE atwrt,
char3 TYPE atwrt,
char4 TYPE atwrt,
char5 TYPE atwrt,
char6 TYPE atwrt,
char7 TYPE atwrt,
char8 TYPE atwrt,
char9 TYPE atwrt,
char10 TYPE atwrt,
char11 TYPE atwrt,
char12 TYPE atwrt,
char13 TYPE atwrt,
char14 TYPE atwrt,
char15 TYPE atwrt,
flag TYPE char1,
error TYPE char50,
END OF ty_file.
To check for duplicates
TYPES: BEGIN OF ty_dupl,
vtnam TYPE vtnam,
char1 TYPE atwrt,
char2 TYPE atwrt,
char3 TYPE atwrt,
char4 TYPE atwrt,
char5 TYPE atwrt,
char6 TYPE atwrt,
char7 TYPE atwrt,
char8 TYPE atwrt,
char9 TYPE atwrt,
char10 TYPE atwrt,
char11 TYPE atwrt,
char12 TYPE atwrt,
char13 TYPE atwrt,
char14 TYPE atwrt,
char15 TYPE atwrt,
slnid TYPE slnid,
END OF ty_dupl.
Get previously loaded characteristic values for internal table (CHAR)
TYPES: BEGIN OF ty_cuvtab_valc,
vtint TYPE vtint, " Internal number of variant table
slnid TYPE slnid, " Key for value combination in variant tab
atinn TYPE atinn, " Internal characteristic
valc TYPE atwrt, " Characteristic Value
END OF ty_cuvtab_valc.
Get previously loaded characteristic values for internal table (NUM)
TYPES: BEGIN OF ty_cuvtab_valn,
vtint TYPE vtint, " Internal number of variant table
slnid TYPE slnid, " Key for value combination in variant tab
atinn TYPE atinn, " Internal characteristic
val_from TYPE atflv, " Internal floating point from
END OF ty_cuvtab_valn.
Store column positions of characteristics
TYPES: BEGIN OF ty_col_pos,
vtint TYPE vtint, " Internal number of variant table
vtnam TYPE vtnam, " Variant table name
atinn TYPE atinn, "Internal characteristic
atnam TYPE atnam, "Characteristic Name
field TYPE fieldname, "Field name
req TYPE char1, " Required or not
vtpos TYPE vtpos, " Item number of characteristics
END OF ty_col_pos.
Store valid values for characteristics
TYPES: BEGIN OF ty_cawn,
atinn TYPE atinn, " Internal characteristic
atzhl TYPE atzhl, " Int counter
atwrt TYPE atwrt, " Characteristic Value
atflv TYPE atflv, " Internal floating point from
lkenz TYPE lkenz, " Deletion indicator
END OF ty_cawn.
Store error messages for individual lines
TYPES: BEGIN OF ty_error,
vtnam TYPE vtnam, " Variant table name
fname TYPE fieldname, " Fieldname
atnam TYPE atnam, " Characteristic name
atwrt TYPE atwrt, " Characteristic value
row TYPE char5, " Row id
END OF ty_error.
Begin TPR# 4618
To store unique number for variant
TYPES: BEGIN OF ty_vnt_ma,
vtnam TYPE vtnam,
unique_no TYPE ZGTDM_UNQN,
no_chr TYPE ZGTDM_NO_CHR,
END OF ty_vnt_ma.
TYPES: BEGIN OF ty_dbtab,
vtint TYPE vtint,
vtnam TYPE vtnam,
DBTAB_NAME TYPE TABNAME16,
END OF ty_dbtab.
To find out concatenated number for
TYPES: BEGIN OF ty_split,
f1 TYPE char6,
END OF ty_split.
TYPES: BEGIN OF ty_charval,
char TYPE char30,
END OF ty_charval.
TYPES: BEGIN OF TY_DATA,
name TYPE string,
value(15) type c,
END OF TY_DATA.
DATA: I_DATATAB TYPE STANDARD TABLE OF TY_DATA. "#EC NEEDED
TYPES:
TUMLS_MESSTYPE type /SAPDMC/LS_MESSTYPE,
TUMLS_MESSTYPETXT type EDI_TEXT60,
TUMLS_MESSCODE type EDIPMESCOD.
TYPES:
TUMLS_TABNAME TYPE TABNAME, "#EC *
TUMLS_SEGMENT TYPE TABNAME. "#EC *
TYPES:
TUMLS_PATHFILE TYPE /SAPDMC/LS_FILENAME,
TUMLS_FILENAME TYPE /SAPDMC/LS_FILENAME,
TUMLS_FILETEXT TYPE /SAPDMC/LS_FILETEXT.
TYPES:
BEGIN OF type_errorline,
msgty type SYMSGTY,
id type SYMSGID,
msgno type symsgno,
par1 type symsgv,
par2 type symsgv,
par3 type symsgv,
par4 type symsgv,
END OF type_errorline.
TYPES:
type_errortab TYPE SORTED TABLE
OF type_errorline
WITH NON-UNIQUE KEY id msgno par1 par2 par3 par4.
DATA:
LV_LINE2 TYPE REF TO DATA.
GLOBAL INTERNAL TABLES
DATA : i_newinput TYPE STANDARD TABLE OF ty_newinput INITIAL SIZE 0."#EC *
DATA : i_contentheader1 TYPE STANDARD TABLE OF ty_contenthd INITIAL SIZE 0."#EC *
DATA : i_contenttab1 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab2 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab3 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab4 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
DATA : i_contenttab5 TYPE STANDARD TABLE OF ty_contenttab INITIAL SIZE 0."#EC *
DATA : i_E1CUV1M TYPE STANDARD TABLE OF E1CUV1M INITIAL SIZE 0."#EC *
DATA : i_errortab TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
GLOBAL WORK AREAS
**Internal Table for the structure TY_T001L
DATA : wa_vartab TYPE ty_vartab. "#EC *
DATA : wa_vartabdate TYPE ty_vartabdate. "#EC *
DATA : wa_vardetails TYPE ty_vardetails. "#EC *
DATA : wa_tabinput TYPE ty_tabinput. "#EC *
DATA : wa_dsninput TYPE ty_dsninput. "#EC *
DATA : wa_newinput TYPE ty_newinput. "#EC *
DATA : wa_gnewinput TYPE ty_newinput. "#EC *
DATA : wa_ginput_data TYPE ty_newinput. "#EC *
DATA : wa_final TYPE ty_final. "#EC *
DATA : wa_content TYPE ty_content. "#EC *
DATA : wa_contenthd TYPE ty_contenthd. "#EC *
DATA : wa_contentheader type ty_contenthd. "#EC *
DATA : wa_contenttab TYPE ty_content. "#EC *
DATA : wa_content1 TYPE ty_content. "#EC *
DATA : wa_contenthd1 TYPE ty_contenthd. "#EC *
DATA : wa_contentheader1 type ty_contenthd. "#EC *
DATA : wa_contenttab1 TYPE ty_content. "#EC *
DATA : wa_contenttab2 TYPE ty_content. "#EC *
DATA : wa_contenttab3 TYPE ty_content. "#EC *
DATA : wa_contenttab4 TYPE ty_content. "#EC *
DATA : wa_contenttab5 TYPE ty_contentTAB. "#EC *
DATA : wa_E1CUVTM TYPE E1CUVTM. "#EC *
DATA : wa_E1CUV1M TYPE E1CUV1M. "#EC *
DATA : wa_E1DATEM TYPE E1DATEM. "#EC *
DATA : wa_error_tab TYPE solisti1. "#EC *
INTERNAL TABLES AND WORK AREAS FOR BDC
*Internal Table to store the data to display the error message
DATA : i_errormsg TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
*Internal Table to store the data to display the error message
DATA : i_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
DATA : itab_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
**Work area to store the data to display the error message
DATA : wa_errormsg TYPE solisti1. "#EC *
**Internal table which will store data for the error log
DATA:i_error_log TYPE STANDARD TABLE OF ty_error_log INITIAL SIZE 0."#EC *
GLOBAL VARIABLES
DATA: G_FILE TYPE string. "#EC *
DATA : g_ctr_input_recs(5) type c. "#EC *
DATA: g_ctr_output_recs(5) type p. "#EC *
data : g_msg(100) type c. "#EC *
data: g_struct_file TYPE string. "#EC *
data: g_login type FILEINTERN. "#EC *
data: g_phyin type string. "#EC *
DATA: g_lprnt type RSPOPSHORT. "#EC *
DATA: g_FNAME1 TYPE STRING. "#EC *
DATA : g_repid TYPE repid, "#EC *
g_exit(1) TYPE C, "#EC *
gx_variant type disvariant. "#EC *
DATA : g_lines TYPE i . "#EC *
data : g_save(1) type c. "#EC *
DATA : g_splid TYPE rspoid . "#EC *
data: p_login type FILEINTERN. "#EC *
data: p_phyin type string. "#EC *
GLOBAL CONSTANTS
CONSTANTS c_msgar TYPE rslgarea VALUE 'F8'. "#EC *
CONSTANTS c_msgid TYPE rslgsubid VALUE 'E'. "#EC *
CONSTANTS c_urgnc TYPE char04 VALUE 'HIGH'. "#EC *
CONSTANTS C_X(1) TYPE C VALUE 'X'. "#EC *
CONSTANTS C_Y(1) TYPE C VALUE 'Y'. "#EC *
CONSTANTS C_Z(1) TYPE C VALUE 'Z'. "#EC *
CONSTANTS C_E(1) TYPE C VALUE 'E'. "#EC *
CONSTANTS C_SAP(3) TYPE C VALUE 'SAP'. "#EC *
CONSTANTS C_MOD(3) TYPE C VALUE 'MOD'. "#EC *
CONSTANTS C_MD1(3) TYPE C VALUE 'MD1'. "#EC *
CONSTANTS C_MD2(3) TYPE C VALUE 'MD2'. "#EC *
CONSTANTS C_MD3(3) TYPE C VALUE 'MD3'. "#EC *
CONSTANTS C_MD4(3) TYPE C VALUE 'MD4'. "#EC *
CONSTANTS C_MD5(3) TYPE C VALUE 'MD5'. "#EC *
constants: c_000001(6) type c value '000001', "#EC *
c_e1cuv1m(7) type c value 'E1CUV1M', "#EC *
c_02(2) type c value '02', "#EC *
c_009(3) type c value '009', "#EC *
c_0001(4) type c value '0001'. "#EC *
constants: c_e1datem(7) type c value 'E1DATEM'. "#EC *
constants: c_e1cuvtm(7) type c value 'E1CUVTM'. "#EC *
GLOBAL INTERNAL TABLES FOR ALV DISPLAY
*Internal tables for ALV Field cat
DATA :
i_fieldcat_ov TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
i_fieldcat_dtl TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
i_fieldcat_ov1 TYPE lvc_t_fcat, "#EC *
i_events TYPE slis_t_event. "#EC *
GLOBAL WORK AREAS FOR ALV DISPLAY
*Work area for ALV Field layout
DATA : wa_layout TYPE slis_layout_alv. "#EC *
*Work area for Field Cat. Table
DATA : wa_fieldcat TYPE slis_fieldcat_alv. "#EC *
GLOBAL VARIABLES FOR ALV DISPLAY
DATA : g_event TYPE slis_t_event. "#EC *
DATA : g_top_of_page TYPE slis_t_listheader. "#EC *
DATA : g_ok_code TYPE char4. "#EC *
DATA : g_variant type disvariant. "#EC *
GLOBAL CONSTANTS FOR ALV DISPLAY
BAL handling
data: iv_log_handle type BALLOGHNDL. "#EC *
data: is_log_header type bal_s_log. "#EC *
data: iv_object type bal_s_log-object value 'CAPI'. "#EC *
data: iv_subobject type bal_s_log-subobject value 'CAPI_LOG'."#EC *
data: iv_tcode type bal_s_log-altcode value 'SE38'. "#EC *
*MOD-005
RANGES:
R_MESTYP FOR EDIDC-MESTYP, "#EC *
R_CREDAT FOR EDIDC-CREDAT, "#EC *
R_CRETIM FOR EDIDC-CRETIM, "#EC *
R_SNDPRT FOR EDIDC-SNDPRT, "#EC *
R_SNDPRN FOR EDIDC-SNDPRN. "#EC *
DATA:
L_MESSTYPE TYPE TUMLS_MESSTYPE. "#EC *
*MOD-005
data: p_sndprn TYPE EDI_SNDPRN, "#EC *
p_sndprt TYPE EDI_SNDPRT, "#EC *
p_sndpor TYPE EDI_SNDPOR. "#EC *
data: p_rcvprn TYPE EDI_RCVPRN, "#EC *
p_rcvprt TYPE EDI_RCVPRT, "#EC *
p_rcvpor TYPE EDI_RCVPOR. "#EC *
data:
init_E1CUVTM type E1CUVTM, "#EC *
prev_E1CUVTM type E1CUVTM, "#EC *
init_E1DATEM type E1DATEM, "#EC *
prev_E1DATEM type E1DATEM, "#EC *
init_E1CUV1M type E1CUV1M, "#EC *
prev_E1CUV1M type E1CUV1M. "#EC *
Source structure definitions
data:
begin of LSMW_TAB_CONTENT, "#EC *
VTNAM(018) type C,
CHAR1(030) type C,
CHAR2(030) type C,
CHAR3(030) type C,
CHAR4(030) type C,
CHAR5(030) type C,
CHAR6(030) type C,
CHAR7(030) type C,
CHAR8(030) type C,
CHAR9(030) type C,
CHAR10(030) type C,
CHAR11(030) type C,
CHAR12(030) type C,
CHAR13(030) type C,
CHAR14(030) type C,
CHAR15(030) type C,
FLAG(001) type C,
end of LSMW_TAB_CONTENT.
Counters
data:
g_cnt_VAR_TAB type i, "#EC *
g_cnt_TAB_CONTENT type i. "#EC *
Counter ct_xxxxxxxxxx: number of transferred records
data:
ct_edi_dc40 type i, "#EC *
cs_edi_dc40 type i, "#EC *
ct_E1CUVTM type i, "#EC *
cs_E1CUVTM type i, "#EC *
ct_E1DATEM type i, "#EC *
cs_E1DATEM type i, "#EC *
ct_E1CUV1M type i, "#EC *
cs_E1CUV1M type i. "#EC *
Global data definitions and data declarations
DATA: wa_cabn TYPE ty_cabn,
wa_cawn TYPE ty_cawn,
wa_file TYPE ty_file,
wa_vtnam TYPE ty_vtnam,
wa_cuvtab_fld TYPE ty_cuvtab_fld,
wa_cuvtab_valn TYPE ty_cuvtab_valn,
wa_cuvtab_valc TYPE ty_cuvtab_valc,
wa_col_pos TYPE ty_col_pos,
wa_error TYPE ty_error,
wa_dupl TYPE ty_dupl,
wa_dupl_file TYPE ty_dupl.
DATA: wa_vnt_ma TYPE ty_vnt_ma,
wa_split TYPE ty_split.
DATA: wa_charval TYPE ty_charval. "#EC *
Internal table
DATA: i_cabn TYPE STANDARD TABLE OF ty_cabn, "#EC *
i_cabn_temp TYPE STANDARD TABLE OF ty_cabn, "#EC *
i_cabn_atinn TYPE STANDARD TABLE OF ty_cabn, "#EC *
i_file TYPE STANDARD TABLE OF ty_file, "#EC *
i_file_tmp TYPE STANDARD TABLE OF ty_file, "#EC *
i_vtnam TYPE STANDARD TABLE OF ty_vtnam, "#EC *
i_cuvtab TYPE STANDARD TABLE OF ty_vtnam, "#EC *
i_cuvtab_fld TYPE STANDARD TABLE OF ty_cuvtab_fld, "#EC *
i_cuvtab_valn TYPE STANDARD TABLE OF ty_cuvtab_valn, "#EC *
i_cuvtab_valc TYPE STANDARD TABLE OF ty_cuvtab_valc, "#EC *
i_col_pos TYPE STANDARD TABLE OF ty_col_pos, "#EC *
i_cawn TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cawn_n TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cawn_c TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cawn_i TYPE STANDARD TABLE OF ty_cawn, "#EC *
i_cuv_error TYPE STANDARD TABLE OF ty_vtnam, "#EC *
i_dupl TYPE STANDARD TABLE OF ty_dupl, "#EC *
i_dbtab TYPE STANDARD TABLE OF ty_dbtab. "#EC *
DATA: i_vnt_ma TYPE STANDARD TABLE OF ty_vnt_ma, "#EC *
i_split TYPE STANDARD TABLE OF ty_split. "#EC *
DATA: i_dupl_file TYPE STANDARD TABLE OF ty_dupl. "#EC *
DATA: i_charval TYPE STANDARD TABLE OF ty_charval. "#EC *
Constants
CONSTANTS: c_char TYPE atfor VALUE 'CHAR', "#EC *
c_date TYPE atfor VALUE 'DATE', "#EC *
c_time TYPE atfor VALUE 'TIME', "#EC *
c_varcond TYPE atnam VALUE 'Z_VARCOND'. "#EC *
Field Symbols
FIELD-SYMBOLS: <fs_vtnam> TYPE ty_vtnam, "#EC *
<fs_cabn> TYPE ty_cabn, "#EC *
<fs_cuvtab_fld> TYPE ty_cuvtab_fld, "#EC *
<fs_dupl> TYPE ty_dupl. "#EC *
FIELD-SYMBOLS: <FS_DYN_WA> TYPE ANY.
Variables
DATA: g_raw(500) TYPE c, "#EC *
g_invalid TYPE char1, "#EC *
g_error TYPE char1, "#EC *
g_message TYPE char50, "#EC *
g_slnid_c TYPE slnid, "#EC *
g_slnid_n TYPE slnid, "#EC *
g_row TYPE char5. "#EC *
DATA: g_varcond TYPE varcond, "Variant condition "#EC NEEDED
g_split_var TYPE i, "#EC *
g_split_var1 type i. "#EC *
Types: begin of ty_charname,
name type atnam,
end of ty_charname.
data: wa_charname type ty_charname, "#EC *
i_charname type standard table of ty_charname. "#EC *
data: cnt_i type i, "#EC *
g_tabix type char10. "#EC *
Types: begin of ty_itab_zedidc40.
include structure edi_dc40.
TYPES: end of ty_itab_zedidc40.
Types: begin of ty_itab_zedidd40.
include structure edi_dd40.
TYPES: end of ty_itab_zedidd40.
DATA: itab_zedidc40 type standard table of
ty_itab_zedidc40 initial size 0. "#EC *
DATA: itab_zedidd40 type standard table of
ty_itab_zedidd40 initial size 0. "#EC *
DATA: wa_itab_zedidc40 type ty_itab_zedidc40. "#EC NEEDED
DATA: wa_itab_zedidd40 type ty_itab_zedidd40.
*MOD-009
data: itab_ze1cuvtm type e1cuvtm, "#EC *
itab_ze1datem type e1datem, "#EC *
itab_ze1cuv1m type e1cuv1m. "#EC *
data: wdocnum(16) type n value 0. "#EC *
data: wsegnum(6) type n value 0. "#EC *
data: witemno(10) type n value 0. "#EC *
data: witemno_new(10) type n value 0. "#EC *
data: witemno_gst(10) type n value 0. "#EC *
data: witemno_qst(10) type n value 0. "#EC *
TYPES: BEGIN OF ty_input_data1, "#EC *
line(560) type c,
flag(1) type c,
END OF ty_input_data1.
DATA: i_input_data type standard table of
ty_input_data1 initial size 0. "with header line.
DATA: i_input_data1 type standard table of
ty_input_data1 initial size 0. "with header line.
DATA: wa_input_data type ty_input_data1. "#EC *
DATA: g_cnt_input_recs type i. "#EC *
DATA: g_flg_error type c. "#EC *
DATA: l_lines type i. "#EC *
DATA: l_lines1 type i. "#EC *
DATA: l_tabix type i. "#EC *
DATA: wa_input_data1 type ty_input_data1. "#EC *
DATA: FILE TYPE STRING.
Fields that are made available to the user:
DATA:
g_cnt_records_read TYPE i, "#EC *
g_cnt_records_transferred TYPE i, "#EC *
g_cnt_transactions_read TYPE i, "#EC *
g_cnt_transactions_transferred TYPE i, "#EC *
g_cnt_idocs_package TYPE i. "#EC *
data: v_log_handle type balloghndl. "#EC *
DATA: gt_curr_edi_dc40 TYPE STANDARD TABLE OF edi_dc40 initial size 0."#EC *
DATA: gt_curr_edi_dd40 TYPE STANDARD TABLE OF edi_dd40 initial size 0."#EC *
DATA: wa_curr_edi_dc40 TYPE edi_dc40. "#EC *
DATA: wa_curr_edi_dd40 TYPE edi_dd40. "#EC *
internal table for error messages during conversion
DATA: g_error_tab TYPE type_errortab, "#EC *
wa_errortab TYPE type_errorline. "#EC *
DATA: g_edidd_segnam type EDI4SEGNAM, "#EC *
g_edidd_hlevel type EDI4HLEVEC. "#EC *
DATA: g_segnum(6) TYPE n.
DATA: g_objecttype(2) type C.
DATA: P_FNAME(128) TYPE C VALUE '/usr/sap/trans/vartabheader'. " MODIF ID MD1 OBLIGATORY.
DATA: P_FNAME1(128) TYPE C VALUE '/usr/sap/trans/vartabcontent'. " MODIF ID MD1 OBLIGATORY.
field-symbols: <dyn_table> type standard table,
<dyn_table1> type standard table,
<dyn_wa>,
<dyn_wa1> TYPE ANY.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
data: l_tabname TYPE tabname.
DATA: l_len_slnid TYPE i, "#EC NEEDED
l_len_varcond TYPE i, "#EC NEEDED
l_temp_slnid TYPE i, "#EC NEEDED
l_temp_slnc TYPE char5, "#EC NEEDED
l_temp_varcond TYPE varcond, "#EC NEEDED
l_sub_var TYPE i, "#EC NEEDED
l_val_split TYPE char10. "#EC NEEDED
DATA: l_invalid. "#EC NEEDED
*Include for Global Data Declaration
*INCLUDE ZGTDMI_VARTAB_TOPDYN.
*INCLUDE /FACTGLB/GTDMI_VARTAB_TOP02.
*Include for Selection Screen
*INCLUDE ZGTDMI_VARTAB_SELDYN.
*INCLUDE /FACTGLB/GTDMI_VARTAB_SEL02.
*Include for Sub Routines
*INCLUDE ZGTDMI_VARTAB_FORMSDYN.
*INCLUDE /FACTGLB/GTDMI_VARTAB_FORMS02.
*& Include /FACTGLB/GTDMI_VARTAB_SEL02 *
*& Include /FACTGLB/GTDMI_VARTAB_SEL
*& Include /FACTGLB/GTDMI_VARTAB_SEL
PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
DEVELOPER: Aveek Ghose
CREATION DATE: 2008-08-25
RDD NUMBER: DCDD027
TRANSPORT NUMBER(S): RD2K902769
*-- REVISION HISTORY -
DEVELOPER:
DATE APPLIED: YYYY-MM-DD
SCR NUMBER: <Scope Change Request ID>
RDD NUMBER: <Toolset Object ID>
TRANSPORT NUMBER(S):
DESCRIPTION:
DECLARATION FOR SELECTION SCREEN
*selection-screen skip 1.
*For all the input field entries
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
*Parameter for Input File Name:
PARAMETERS: p_inpt TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File Variant table
PARAMETERS: p_inpt1 TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File variant Content
SELECTION-SCREEN END OF BLOCK bl1.
IDoc creation
selection-screen begin of block idocpars
with frame title text-006.
parameters:
p_trfcpt as checkbox default C_X MODIF ID MD3,
p_packge(5) type n default 1 MODIF ID MD3.
selection-screen end of block idocpars.
SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-032.
Radio Buttons :
parameters:
rb_apsrv RADIOBUTTON GROUP RB1 DEFAULT 'X' USER-COMMAND UCOM,
rb_convt RADIOBUTTON GROUP RB1,
rb_idoc RADIOBUTTON GROUP RB1.
rb_proc RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF BLOCK bl3.
INITIALIZATION
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INPT.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = C_X
CHANGING
FILE_NAME = P_INPT
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE e241.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INPT1.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = C_X
CHANGING
FILE_NAME = P_INPT1
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
-
Hi
I copied our entire music folder from our old pc on to the new imac, and all the apps, music etc is there, but no individual libarys, we had 5 very different ones, when pressing and holding the alt key on opeing itunes, nothing happens it just opens into itunes, no option to choose or create a libary, what am i doing wrong?Did you copy the entire iTunes folder, not just media? This includes the critical library.itl file.
Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/message/13025536 and https://discussions.apple.com/message/17457605
Now you say you had 5 libraries. If you really mean that then you would have to have copied 5 different iTunes folders in their entirety, not just one folder. Anyway, something makes me feel you did not copy a whole iTunes folder and all its subfolders and files, you only copied the music.
On the starting with the option (alt) key held down I really don't know what to advise. It works for me hundreds of times and just about everybody else here. The only thing I can suggest is to hold the key down longer or perhaps start iTunes and then 1 second later hold down the key for a few seconds. -
hello, i have a question. i think i know the answer already just want to make sure with you gurus. someone told me that structures don ot contain data. but i have seen code where people enhance structures that are on LBWE screen. so if they append structure where is the data kept? like i know there are underlying tables like vbap, vbak etc. ok. so the data comes from those tables in structure if i had to append the structures? then what happens? does it then go to setup table? or where does it go and what triggers the data to come into structures from those tables? please help. thanks. e.g. structure like MC02_0SGR etc.
I did some search and found some stuff.so when user hits save button ok it saves the data in database table and also that record will be sent to LBWQ in logistics appalication case. ok. so if i append some structure and do some enhancement on it. let's say i add a field called quantity in it ok, and i do some coding. i bring the record in internal table and say something like MC02_0SGR-Quantity - Internal table-Quantity if some condition meet. ok so then. next time when user saves a record it will go straight to lets say vbak table and the same record will also go to lbwq. am i correct? at the time when user saved the record it didnot have that quantity field calculated because it has not gone through my code yet. right? i am just trying to understand the flow. i don't know if there is any documentation on this or not. can someone help me please? i am confused. thanks guys.
Edited by: Vik1900 on Jun 13, 2009 2:28 PMHi,
If you enhance the DS in ECC..
Eg: I enhanced XYZ- Structure and added ZQty field, and it will fetch the data from ABC Table using some code in CMOD, when users enter the data through some TCODE in ECC, the data wil store in base tables from there using Code we are fetching and extracting into BW. You can see the data in LBWQ/RSA7 in ECC, which contains the data for all fields which are there in Data Source.
If you want to load data to BW, using setup tables, you must take some down time in ECC and load tha data..
Steps:
1. Take down Time in ECC
2. Delete setup tables in ECC.
3. Clear RSA7 in ECC, by running V3 job 2/3 times and loading deltas in BW.
4. Check whethee it is cleared or not in SMQ1 and RSA7.
5. Fill the setup tables.
6. Load Init data in BW.
7. Set V3 job in ECC and Load deltas in BW.
Thanks
Reddy -
CJ20N - project structure and data import
Hello dear SAP specialists,
Does anybody ever created a ABAP program to import project structure and populate it with data?
I'm trying to start with something or get a working program to import some projects with data.
Actually the program should use BAPI_PROJECT_MAINTAIN to create WBS and GUI_UPLOAD to read a text (cvs) file (LSMW can not be used:)
Sincerely,
MeHi,
Exactly!
See you have so many tables in that BAPI, now all the data you have in your flat file you have to map to these tables.
Below is a code...similarly you'll have to do
TYPE-POOLS: truxs.
* T Y P E S
TYPES: BEGIN OF t_master_data,
MATERIAL Type MATNR ,
IND_SECTOR Type MBRSH ,
MATL_TYPE Type MTART ,
PLANT Type WERKS ,
STGE_LOC Type LGORT_D ,
MATL_DESC Type MAKTX ,
BASE_UOM Type MEINS ,
MATL_GROUP Type MATKL ,
DIVISION Type SPART ,
ITEM_CAT Type MTPOS_MARA ,
GROSS_WT Type BRGEW ,
UNIT_OF_WT Type GEWEI ,
NET_WEIGHT Type NTGEW ,
VOLUME Type VOLUM ,
SIZE_DIM Type GROES ,
BASIC_MATL Type WRKST ,
DOCUMENT Type DZEINR ,
DOC_VERS Type DZEIVR ,
PO_UNIT Type BSTME ,
PUR_GROUP Type EKGRP ,
AUTO_P_ORD Type KAUTB ,
"BATCH_MGMT Type XCHPF ,
PUR_VALKEY Type EKWSL ,
"GR_PR_TIME Type WEBAZ ,
COMM_CODE Type STAWN ,
COUNTRYORI Type HERKL ,
MRP_TYPE Type DISMM ,
REORDER_PT Type MINBE ,
MRP_CTRLER Type DISPO ,
LOTSIZEKEY Type DISLS ,
MINLOTSIZE Type BSTMI ,
MAXLOTSIZE Type BSTMA ,
FIXED_LOT Type BSTFE ,
MAX_STOCK Type MABST ,
ROUND_VAL Type BSTRF ,
PROC_TYPE Type BESKZ ,
SPPROCTYPE Type SOBSL ,
ISS_ST_LOC Type LGPRO ,
SLOC_EXPRC Type LGFSB ,
PLND_DELRY Type PLIFZ ,
GR_PR_TIME Type WEBAZ ,
SM_KEY Type FHORI ,
SAFETY_STK Type EISBE ,
PLNG_PLANT Type PRWRK ,
AVAILCHECK Type MTVFP ,
DEP_REQ_ID Type SBDKZ ,
ISSUE_UNIT Type AUSME ,
STGE_BIN Type LGPBE ,
BATCH_MGMT Type XCHPF ,
STGEPERIOD Type MAXLZ ,
STGE_PD_UN Type LZEIH ,
MINREMLIFE Type MHDRZ ,
SHELF_LIFE Type MHDHB ,
PERIOD_IND_EXPIRATION_DATE Type DATTP ,
ROUND_UP_RULE_EXPIRATION_DATE Type RDMHD ,
STOR_PCT Type MHDLP ,
QM_AUTHGRP Type QMATAUTH ,
QM_PROCMNT Type QMPUR ,
CTRL_KEY Type SSQSS ,
* Type ART ,
* Type AKTIV ,
VAL_CAT Type BWTTY_D ,
VAL_CLASS Type BKLAS ,
PRICE_CTRL Type VPRSV ,
* NEW ADDITION
STD_PRICE Type STPRS,
PRICE_UNIT Type PEINH ,
MOVING_PR Type VERPR ,
QTY_STRUCT Type CK_EKALREL ,
ORIG_GROUP Type HRKFT ,
ORIG_MAT Type HKMAT ,
VARIANCE_KEY Type AWSLS ,
PROFIT_CTR Type PRCTR ,
LANGU Type SPRAS,
END OF t_master_data.
* I N T E R N A L T A B L E S
DATA:
* Internal table of type t_master_data
ist_master_data TYPE TABLE OF t_master_data,
* Internal table of type BAPIMATHEAD
ist_headdata TYPE TABLE OF BAPIMATHEAD,
* Internal table of type BAPI_MAKT
ist_mat_desc TYPE TABLE OF BAPI_MAKT,
* Internal table of type BAPI_MAKT
ist_uom TYPE TABLE OF BAPI_MARM,
* Internal table of type BAPI_MAKTX
ist_uom_x TYPE TABLE OF BAPI_MARMX.
* G L O B A L V A R I A B L E S
DATA:
it_num TYPE num10,
* Global variable of type truxs_t_text_data
it_raw TYPE truxs_t_text_data.
* W O R K A R E A S
DATA:
* Work area of type t_master_data
wa_master_data TYPE t_master_data,
* Work area of type bapimathead
wa_bapimathead TYPE BAPIMATHEAD,
* Work area of type bapi_mara
wa_client_data TYPE BAPI_MARA,
* Work area of type bapi_marax
wa_client_data_x TYPE BAPI_MARAX,
* Work area of type bapi_marc
wa_plant_data TYPE BAPI_MARC,
* Work area of type bapi_marcx
wa_plant_data_x TYPE BAPI_MARCX,
* Work area of type bapi_mard
wa_storage_location_data TYPE BAPI_MARD,
* Work area of type bapi_mardx
wa_storage_location_data_x TYPE BAPI_MARDX,
* Work area of type bapi_mbew
wa_valuation_data TYPE BAPI_MBEW,
* Work area of type bapi_mbewx
wa_valuation_data_x TYPE BAPI_MBEWX,
* Work area of type bapi_mard
wa_mat_desc TYPE BAPI_MAKT,
* Work area of type bapi_marm
wa_uom TYPE BAPI_MARM,
* Work area of type bapi_marmx
wa_uom_x TYPE BAPI_MARMX,
* Work area of type mbapi_mpgd
wa_planning_data TYPE BAPI_MPGD,
* Work area of type mbapi_mpgdx
wa_planning_data_x TYPE BAPI_MPGDX,
* Work area of type mbapi_mpgd
wa_return TYPE BAPIRET2.
* P A R A M E T E R S
PARAMETERS:
* Parameter of type rlgrap-filename
p_file TYPE rlgrap-filename.
* A T S E L E C T I O N S C R E E N
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
* S T A R T - O F - S E L E C T I O N.
START-OF-SELECTION.
* To upload data from flat file
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = ist_master_data[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT ist_master_data INTO wa_master_data.
it_num = wa_master_data-PROFIT_CTR.
wa_master_data-PROFIT_CTR = it_num.
MOVE-CORRESPONDING wa_master_data to wa_bapimathead.
MOVE-CORRESPONDING wa_master_data to wa_client_data.
wa_client_data_x-MATL_GROUP = 'X'.
wa_client_data_x-BASE_UOM = 'X'.
wa_client_data_x-PO_UNIT = 'X'.
wa_client_data_x-DOCUMENT = 'X'.
wa_client_data_x-SIZE_DIM = 'X'.
wa_client_data_x-BASIC_MATL = 'X'.
wa_client_data_x-PUR_VALKEY = 'X'.
wa_client_data_x-NET_WEIGHT = 'X'.
wa_client_data_x-UNIT_OF_WT = 'X'.
wa_client_data_x-DIVISION = 'X'.
wa_client_data_x-BATCH_MGMT = 'X'.
wa_client_data_x-QM_PROCMNT = 'X'.
wa_client_data_x-MINREMLIFE = 'X'.
wa_client_data_x-SHELF_LIFE = 'X'.
wa_client_data_x-STOR_PCT = 'X'.
wa_client_data_x-ROUND_UP_RULE_EXPIRATION_DATE = 'X'.
wa_client_data_x-PERIOD_IND_EXPIRATION_DATE = 'X'.
wa_client_data_x-ITEM_CAT = 'X'.
MOVE-CORRESPONDING wa_master_data to wa_plant_data.
wa_plant_data_x-PLANT = wa_master_data-plant.
wa_plant_data_x-PUR_GROUP = 'X'.
wa_plant_data_x-ISSUE_UNIT = 'X'.
wa_plant_data_x-MRP_TYPE = 'X'.
wa_plant_data_x-MRP_CTRLER = 'X'.
wa_plant_data_x-PLND_DELRY = 'X'.
wa_plant_data_x-GR_PR_TIME = 'X'.
wa_plant_data_x-LOTSIZEKEY = 'X'.
wa_plant_data_x-PROC_TYPE = 'X'.
wa_plant_data_x-SPPROCTYPE = 'X'.
wa_plant_data_x-SAFETY_STK = 'X'.
wa_plant_data_x-MINLOTSIZE = 'X'.
wa_plant_data_x-MAXLOTSIZE = 'X'.
wa_plant_data_x-FIXED_LOT = 'X'.
wa_plant_data_x-ROUND_VAL = 'X'.
wa_plant_data_x-MAX_STOCK = 'X'.
wa_plant_data_x-DEP_REQ_ID = 'X'.
wa_plant_data_x-SM_KEY = 'X'.
wa_plant_data_x-STGEPERIOD = 'X'.
wa_plant_data_x-STGE_PD_UN = 'X'.
wa_plant_data_x-CTRL_KEY = 'X'.
wa_plant_data_x-BATCH_MGMT = 'X'.
wa_plant_data_x-AVAILCHECK = 'X'.
wa_plant_data_x-AUTO_P_ORD = 'X'.
wa_plant_data_x-COMM_CODE = 'X'.
wa_plant_data_x-COUNTRYORI = 'X'.
wa_plant_data_x-PROFIT_CTR = 'X'.
wa_plant_data_x-ISS_ST_LOC = 'X'.
wa_plant_data_x-VARIANCE_KEY = 'X'.
wa_plant_data_x-SLOC_EXPRC = 'X'.
wa_plant_data_x-QM_AUTHGRP = 'X'.
MOVE-CORRESPONDING wa_master_data to wa_planning_data.
wa_planning_data_x-PLANT = wa_master_data-plant.
wa_planning_data_x-PLNG_PLANT = 'X'.
MOVE-CORRESPONDING wa_master_data to wa_storage_location_data.
wa_storage_location_data_X-PLANT = wa_master_data-plant.
wa_storage_location_data_X-STGE_LOC = wa_master_data-stge_loc.
wa_storage_location_data_X-STGE_BIN = 'X'.
MOVE-CORRESPONDING wa_master_data to wa_valuation_data.
wa_valuation_data-VAL_AREA = '1000'.
wa_valuation_data_X-VAL_AREA = '1000'.
wa_valuation_data_X-PRICE_CTRL = 'X'.
wa_valuation_data_X-MOVING_PR = 'X'.
wa_valuation_data_X-PRICE_UNIT = 'X'.
wa_valuation_data_X-STD_PRICE = 'X'.
wa_valuation_data_X-VAL_CLASS = 'X'.
wa_valuation_data_X-ORIG_GROUP = 'X'.
wa_valuation_data_X-QTY_STRUCT = 'X'.
wa_valuation_data_X-ORIG_MAT = 'X'.
MOVE-CORRESPONDING wa_master_data to wa_mat_desc.
APPEND wa_mat_desc to ist_mat_desc.
IF wa_master_data-PRICE_CTRL = 'S' AND wa_master_data-STD_PRICE IS INITIAL.
WRITE:/ 'Standard Price not maintained for material ',wa_master_data-MATERIAL.
ELSE.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = wa_bapimathead
CLIENTDATA = wa_client_data
CLIENTDATAX = wa_client_data_x
PLANTDATA = wa_plant_data
PLANTDATAX = wa_plant_data_X
PLANNINGDATA = wa_planning_data
PLANNINGDATAX = wa_planning_data_x
STORAGELOCATIONDATA = wa_storage_location_data
STORAGELOCATIONDATAX = wa_storage_location_data_x
VALUATIONDATA = wa_valuation_data
VALUATIONDATAX = wa_valuation_data_x
IMPORTING
RETURN = wa_return
TABLES
MATERIALDESCRIPTION = ist_mat_desc.
Write:/ wa_return-message.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Clear: wa_bapimathead
,wa_client_data
,wa_client_data_x
,wa_plant_data
,wa_plant_data_X
,wa_planning_data
,wa_planning_data_x
,wa_storage_location_data
,wa_storage_location_data_x
,wa_valuation_data
,wa_valuation_data_x.
ENDIF.
REFRESH ist_mat_desc.
ENDLOOP.
ELSE.
Write:/ text-001.
ENDIF.
In the above code note how i have taken the same names for the fields in internal table as they are in the BAPI so that the mapping of data becomes easier, since i use MOVE CORRESPONDING.
Regards,
Shraddha
Edited by: shraddha85 on Jan 31, 2011 9:49 AM
Maybe you are looking for
-
I have created a website on iWeb and would like to post it to a domain name. I don't know much about this part and would like advice. Where can I get a domain name and what can I expect to pay. Then, once I have it, how do I post the website I create
-
Dear All, We are running SAP versin 6.0 and have the ability to attach documents, scans, etc in the GUI on TRIP and PR05 However we would like to be able to make the same attachments in the SAP Portal. What is needed to activate this functionality i
-
In CS6 - how can I un-blur text within a photo taken at a seminar of a powerpoint slide presentation
Is there a way in CS6 to un-blur or "clean-up" text within a photo taken during a powerpoint slide show presentation at a seminar ?
-
Missing Role when saving CR object in BW
Hi all, I am trying to save a CR created on BW query. However, using the SAP toolbar save prompts no role in the window to save the report to. Can someone plz suggest where did I miss something. I have roles created and assigned to this user in conte
-
Is it Possible with Leopard?
Is it possible to run a MacMini (with no screen conected) tru screen sharing on a iMac 24" over firewire network? if so, can we use in the Macmini a screen resolution of say... 1900 x 1200 ?