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

Adding records to a custom table

Former Member
0 Likes
1,212

Hi friends!

I need to create a report with a transaction so that I can directly enter the records into this custom table using the transaction . can anyone explain me how to go about doing it . Basically I have a custom table which adds records to the custom table called allocation table.I need to create a report with a transaction which will update the table using this transaction.

Kindly help.

thanks

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
1,084

Well, in that case you shouldn't create a report, but a module pool, which is used for transaction programming (dialog programming).

1. Create a module pool program (type MODULE POOL).

2. Create screen for entering data.

3. Put UI elements on screen according to your custom table (use the structure for putting the elements on screen on the fly).

4. Create PBO (process before output and PAI (process after input).

5. Create GUI status and GUI Title.

6. Handle user command.

7. Insert data into custom table.

Hi friends!

I need to create a report with a transaction so that I can directly enter the records into this custom table using the transaction . can anyone explain me how to go about doing it . Basically I have a custom table which adds records to the custom table called allocation table.I need to create a report with a transaction which will update the table using this transaction.

Kindly help.

thanks

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
1,085

Well, in that case you shouldn't create a report, but a module pool, which is used for transaction programming (dialog programming).

1. Create a module pool program (type MODULE POOL).

2. Create screen for entering data.

3. Put UI elements on screen according to your custom table (use the structure for putting the elements on screen on the fly).

4. Create PBO (process before output and PAI (process after input).

5. Create GUI status and GUI Title.

6. Handle user command.

7. Insert data into custom table.

Read only

Former Member
0 Likes
1,084

hI!

I already have a report which does the work of entering the records in the allocation table through the maintaince of table view which goes through a call transaction ZALC1 which is for a module pool program , I just now need a small report and call the at very transaction , but this will have a extra validation against mseg table.

The existing report is as follows.

&----


REPORT zmm_zalc_screen.

TABLES:

zalloc. " Allocation table.

DATA:

ltp_memid TYPE char_60. " Memory id for cluster.

PARAMETERS:

pa_werks TYPE werks_d OBLIGATORY. " Plant.

SELECT-OPTIONS:

so_lgort FOR zalloc-zlgort, " Storage location.

so_budat FOR zalloc-zbudat, " Posting date.

so_charg FOR zalloc-zcharg MATCHCODE OBJECT mch1. " Batch number.

END-OF-SELECTION.

SELECT COUNT(*) FROM zalloc WHERE

zwerks EQ pa_werks AND

zlgort IN so_lgort AND

zbudat IN so_budat AND

zcharg IN so_charg.

IF sy-dbcnt = 0.

MESSAGE i003(/spe/cons_api).

  • No records found for given selection criteria.

ELSE.

CONCATENATE sy-uname sy-datum INTO ltp_memid.

EXPORT pa_werks = pa_werks so_lgort = so_lgort so_budat = so_budat so_charg = so_charg TO MEMORY ID ltp_memid.

CALL TRANSACTION 'ZALC1'.

ENDIF.

I have to create a new report based on this report with the specifications mentioned in the previos thread.

Thanks

Read only

Former Member
0 Likes
1,084

Hi Aarav,

instead of creating a custom report, create a maintenance view.. You can assign this to a transaction code (For this, first create a transaction variant through transaction "SHD0" and use this transaction variant in SE93 for creating a transaction...

Edited by: Karthik S Kumar on May 13, 2008 11:25 PM

Read only

0 Likes
1,084

Hi!

I alreday have a maintenance view table , basically I have been asked to create a report which will enter a record into my ZALLOC table through running this new transaction.Its like listed below for better understanding.

Frame this entire section – “Selection Criteria:”

--new block

Selection Screen:

Material Document of Original Transfer Posting (101/311): __________ (ZALLOC- ZMBLNR)

Receiving Plant/S.Loc. Item of Original Transfer Posting (101/311): ____ (ZALLOC- ZZEILE)

Material Document of Pro-rationed Transfer Posting (901/911): __________ (ZALLOC-ZMBLNR_PRO)

Receiving Plant/S.Loc. Item of Pro-rationed Transfer Posting (901/911): ____ (ZALLOC- ZZEILE_PRO)

--end block

--new block

Issuing Plant: ____ (ZALLOC-ZWERKS_ISS)

Issuing Storage Location: ____ (ZALLOC-ZLGORT_ISS)

Receiving Plant: ____ (ZALLOC-ZWERKS)

Receiving Storage Location: ____ (ZALLOC-ZLGORT)

Batch: TRANSFERS (ZALLOC-ZCHARG non-changeable default ‘TRANSFERS’)

--end block

Program Flow:

- Find the material document lines of the pro-rationed transfer posting.

- Check to see if the pro-rationed document is a 901 or a 911 material document. Display hard error ‘Pro-rationed document item is not a 901 or 911 movement type’

- Check to make sure that the MSEG-WERKS and LGORT match the receiving plant and storage location ZWERKS and ZLGORT. Display Hard Error – ‘Provided pro-rationed item plant and storage location does not match the provided receiving plant and storage location.’

- Check the material document ZMBLNR_PRO and ZZEILE_PRO for MSEG-SHKZG = ‘S’. Display hard error ‘Item Line is not an Inbound Item into Receiving Facility. Check for correct item line in pro-rationed material document (901/911)’

- Check to see if this key has already been entered into the ZALLOC table.

- If it is grab the volume from the item line, populate all fields

- Use the Posting Date as the date.

- Insert it into the table.

- Provide success/error report to show the record entered.

If this would help in helping me out , would be highly appreciated.

Thanks

Read only

0 Likes
1,084

I gone with the selection screen and few program lines but I am confused in between the program lines and I am not able to recah the solution .

Kindly help me out please in going through the program lines please.

Thanks