2

Adding Expiry Date Column to Batch Selection Scree... - SAP Community

 7 months ago
source link: https://community.sap.com/t5/customer-relationship-management-q-a/adding-expiry-date-column-to-batch-selection-screen-in-customer-checkout/qaq-p/13607337
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Adding Expiry Date Column to Batch Selection Screen in Customer Checkout

Ashen

Discoverer

Friday

Dear experts,

I hope this message finds you well.

I have a requirement to add an extra column of expiry date to the batch selection screen from B1 of Sap Customer Checkout through a plugin.

Ashen_0-1708053420840.png

Kindly note that we are working with the SAP Customer Checkout version 2.0 FP17.

To develop the new feature, I have planned to build a new screen for the batch selection.

Here is where I trigger the event (for popup new screen) for selecting the batch number from the CCO backend.

@PluginAt(pluginClass = ManagedByBatchOrSerialNumberPosService.class, method = "fetchBatchOrSerialNumbers", where = POSITION.BEFORE)

               public void checkBatchItem(Object proxy, Object[] args, StackTraceElement caller) {

                              JSONObject payLoad = new JSONObject();

                              payLoad.put("type", "event");

                              payLoad.put("eventName", "EXTEND_EXPIRY_DATE_EVENT");

                              //adding event payload data article id, quantity and stock location

                              BroadcasterHolder.INSTANCE.getBroadcaster().broadcastActionForPath("/ws/tech", "plugin", payLoad);

                              logger.info("--------------------------------------------------------");

               }

Here is the JS code for listening to the event. 

this.eventBus.subscribe({
			'handleEvent': (event) =>{
				if(event.getType() == "EXTEND_EXPIRY_DATE_EVENT"){
					const payLoad = event.getPayload();
					console.log(payLoad);
					const popupConfig = {
						//popup configurations
}
					
					this.eventBus.push('SHOW_GENERIC_POPUP', popupConfig);
					
				}

			}
		});
	}

And these are also a work fine. But the main problem is

  1. Where should I set the batch number to show in the previous menu (Where to return the batch number)?
  2. Showing data on the newly created menu?

I have created a separate scenario package for retrieving the data including the expiry date. 

Here is the output of the scenario package.

<CheckNumberReturn>
    <Row>
        <BatchNr>BATCH001</BatchNr>
        <MnfDate/>
        <ExpDate>2022-04-30 00:00:00.0</ExpDate>
        <Quantity>38</Quantity>
    </Row>
    <Row>
        <BatchNr>BATCH002</BatchNr>
        <MnfDate/>
        <ExpDate>2022-04-30 00:00:00.0</ExpDate>
        <Quantity>22</Quantity>
    </Row>
</CheckNumberReturn>

Your valuable guidance, articles, or documents related to solving these problems are greatly appreciated.

Thank You.!

Best Regards,

Ashen.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK